From d5e3455f6f81b90935b556bc5a0bfb58e8c9cbb3 Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Wed, 25 Dec 2024 16:03:03 +0800 Subject: [PATCH] =?UTF-8?q?[686][hardware]LED=E5=B1=8F=E5=B9=95=20?= =?UTF-8?q?=E7=BA=A2=E7=BB=BF=E7=81=AF=E4=B8=8D=E6=B6=88=E5=A4=B1=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/support/device/led/BaseLedUIViewModel.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/mogo-hardware-devices/src/main/java/com/mogo/support/device/led/BaseLedUIViewModel.kt b/libraries/mogo-hardware-devices/src/main/java/com/mogo/support/device/led/BaseLedUIViewModel.kt index 9facfa6489..a0ac9b56eb 100644 --- a/libraries/mogo-hardware-devices/src/main/java/com/mogo/support/device/led/BaseLedUIViewModel.kt +++ b/libraries/mogo-hardware-devices/src/main/java/com/mogo/support/device/led/BaseLedUIViewModel.kt @@ -53,7 +53,7 @@ open class BaseLedUIViewModel : ViewModel() { currentStationReportUI = StationReportUI(stationName, state) } - open fun receive(msg: LedUI) { + open suspend fun receive(msg: LedUI) { Log.e( TAG, "receive --> ${msg.javaClass.simpleName}[priority=${msg.priority}] current:${currentLedUI.javaClass.simpleName}[priority=${currentLedUI.priority}]" @@ -118,7 +118,7 @@ open class BaseLedUIViewModel : ViewModel() { } } - private fun showUI(msg: LedUI) { + private suspend fun showUI(msg: LedUI) { Log.i(TAG, "showUI ledUI=${msg.javaClass.simpleName}[priority=${msg.priority}]") // 如果当前类型是 需要打断恢复的,放入等待队列 if (currentLedUI.interruptRestore) { @@ -157,7 +157,7 @@ open class BaseLedUIViewModel : ViewModel() { } } - private fun dismissUI(msg: LedUI) { + private suspend fun dismissUI(msg: LedUI) { Log.i(TAG, "dismissUI ledUI=${msg.javaClass.simpleName}[priority=${msg.priority}]") currentCountDownJob?.also { it.cancel() @@ -166,7 +166,7 @@ open class BaseLedUIViewModel : ViewModel() { restoreLastUI() } - private fun restoreLastUI() { + private suspend fun restoreLastUI() { //恢复打断 val restoreUI = pollRestoreLedUI() if (restoreUI != null) { @@ -177,7 +177,7 @@ open class BaseLedUIViewModel : ViewModel() { } } - private fun startBasicUISwitchLoop() { + private suspend fun startBasicUISwitchLoop() { if (currentRouteInfoUI != null) { showUI(currentRouteInfoUI!!) } else if (currentStationReportUI != null) { @@ -193,7 +193,7 @@ open class BaseLedUIViewModel : ViewModel() { kotlin.runCatching { baseUICountDownJob?.cancel() } } - private fun basicUISwitchInternal() { + private suspend fun basicUISwitchInternal() { Log.i(TAG, "baseUISwitchInternal()") cancelBasicUISwitch() viewModelScope.launch {