[6.7.0][V2N] 优化代码逻辑
This commit is contained in:
@@ -146,9 +146,8 @@ class TeleMsgHandler : IMsgHandler {
|
||||
val content = String(it.body, Charset.defaultCharset())
|
||||
Log.d(TAG, "乘客屏收到司机屏转发的新链路开关 --- 2 ---:$content")
|
||||
val data = GsonUtils.fromJson(content, Map::class.java)
|
||||
val f1 = data["f1"] as Boolean
|
||||
val f2 = data["f2"] as Boolean
|
||||
Log.d(TAG, "乘客屏收到司机屏转发的新链路开关 --- 3 ---:$data, f1: $f1, f2:$f2")
|
||||
val f1 = data["f1"] as? Boolean ?: false
|
||||
Log.d(TAG, "乘客屏收到司机屏转发的新链路开关 --- 3 ---:$data, f1: $f1")
|
||||
FunctionBuildConfig.v2nTotalSwitch = f1
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
|
||||
@@ -59,6 +59,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.vehicle.SweeperVehicleConfigUtils
|
||||
import com.mogo.eagle.core.utilcode.rv.divider.CommonDividerItemDecoration
|
||||
import com.mogo.eagle.core.utilcode.util.AppStateManager
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils.*
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.zhjt.mogo.adas.data.AdasConstants
|
||||
import com.zhjt.mogo.adas.data.bean.AdasParam
|
||||
@@ -397,6 +398,10 @@ class OperatePanelLayout : LinearLayout {
|
||||
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(KEY_V2N_NEW_LINKED_TO_PNC)?.also { changeValue(it, false) }
|
||||
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(KEY_V2N_NEW_LINKED_GREEN_WAVE)?.also { changeValue(it, false) }
|
||||
}
|
||||
val map = HashMap<String, Boolean>().also {
|
||||
it["f1"] = isChecked
|
||||
}
|
||||
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, toJson(map).toByteArray())
|
||||
return true
|
||||
}
|
||||
KEY_V2N_NEW_LINKED_TO_PNC -> {
|
||||
|
||||
Reference in New Issue
Block a user