[8.2.0][opt]新增MogoMind运营面板的开关

This commit is contained in:
chenfufeng
2025-08-18 20:21:24 +08:00
parent 48fe09c8fe
commit 152f316bc0
7 changed files with 118 additions and 108 deletions

View File

@@ -380,6 +380,13 @@ class TeleMsgHandler : IMsgHandler {
)
}
TelematicConstant.CONTROL_PASSENGER_AI_SWITCH -> {
CallerTelematicListenerManager.invokeReceivedMsg(
TelematicConstant.CONTROL_PASSENGER_AI_SWITCH,
it.body
)
}
TelematicConstant.SHOW_TRAFFIC_LIGHT -> {
val trafficLightJson = String(it.body)
CallerTrafficLightListenerManager.invokeTrafficLightStatus(

View File

@@ -1066,6 +1066,7 @@ class OperatePanelLayout : LinearLayout {
private const val KEY_SWEEPER_CLOUD_CONTROL = "sweeper_cloud_control"
private const val KEY_LOOK_AROUND_360 = "look_around_360"
private const val KEY_DRIVE_SEAT_VIDEO_STREAM = "drive_seat_video_stream"
private const val KEY_MOGO_MIND_SWITCH = "mogo_mind_switch"
}
private var lastTimeOnSendDriveVideo = 0L
@@ -1358,6 +1359,21 @@ class OperatePanelLayout : LinearLayout {
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.DRIVE_SEAT_VIDEO_STREAM_REQ, toJson(map).toByteArray())
return false
}
KEY_MOGO_MIND_SWITCH -> {
val isChecked = newValue as? Boolean ?: false
if (isChecked) {
CallerTelematicManager.sendMsgToAllClients(
TelematicConstant.CONTROL_PASSENGER_AI_SWITCH,
"1".toByteArray()
)
} else {
CallerTelematicManager.sendMsgToAllClients(
TelematicConstant.CONTROL_PASSENGER_AI_SWITCH,
"0".toByteArray()
)
}
return true
}
}
return super.onPreferenceChange(preference, newValue)
}

View File

@@ -58,5 +58,12 @@
android:persistent="false"
android:enabled="false"
android:widgetLayout="@layout/layout_operate_panel_preference_widget_switch_compat" />
<SwitchPreferenceCompat
android:key="mogo_mind_switch"
android:layout="@layout/layout_operate_panel_preference_switch_compat"
android:title="MogoMind开关"
android:persistent="false"
android:enabled="true"
android:widgetLayout="@layout/layout_operate_panel_preference_widget_switch_compat" />
</PreferenceCategory>
</androidx.preference.PreferenceScreen>