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 {