[m1-p-1.1.0] fix bug of debug setting view
This commit is contained in:
@@ -180,11 +180,20 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
initView()
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var isRunCheck = true
|
||||
|
||||
/**
|
||||
* 定时刷新视图数据,防止因为过快更新导致anr异常
|
||||
*/
|
||||
private val timerTaskRefresh = object : TimerTask() {
|
||||
override fun run() {
|
||||
if(this@DebugSettingView == null){
|
||||
return
|
||||
}
|
||||
if(!isRunCheck){
|
||||
return
|
||||
}
|
||||
UiThreadHandler.post {
|
||||
// 绘制应用基本信息
|
||||
drawAppInfo()
|
||||
@@ -225,6 +234,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
logInfoView!!.onEnterForeground()
|
||||
}
|
||||
// 开启定时查询速度
|
||||
isRunCheck = true
|
||||
Timer().schedule(timerTaskRefresh, Date(), 300)
|
||||
if (AppConfigInfo.isConnectAutopilot && (AppConfigInfo.plateNumber.isNullOrEmpty() || AppConfigInfo.iPCMacAddress.isNullOrEmpty())) {
|
||||
//查询工控机基础配置信息
|
||||
@@ -272,6 +282,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
logInfoView!!.onEnterBackground()
|
||||
}
|
||||
try {
|
||||
isRunCheck = false
|
||||
timerTaskRefresh.cancel()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
@@ -1526,7 +1537,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
"移动数据"
|
||||
} else {
|
||||
//WiFi
|
||||
CommonUtils.getWifiName(context)
|
||||
CommonUtils.getWifiName(context)?:""
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -1565,7 +1576,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
else -> {
|
||||
"乘客端${
|
||||
when {
|
||||
AppConfigInfo.serverSn.isNotEmpty() -> "(司机屏SN是:${AppConfigInfo.serverSn})"
|
||||
!AppConfigInfo.serverSn.isNullOrEmpty() -> "(司机屏SN是:${AppConfigInfo.serverSn?:""})"
|
||||
else -> ""
|
||||
}
|
||||
}连接"
|
||||
|
||||
Reference in New Issue
Block a user