[6.1.0][opt]更新接口

This commit is contained in:
chenfufeng
2023-09-15 12:07:54 +08:00
parent 25b819979a
commit 14c577110f

View File

@@ -12,11 +12,11 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoParallelDrivingActionsListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoParallelDrivingStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager.getUnableAutopilotReasons
import com.mogo.eagle.core.function.call.autopilot.CallerParallelDrivingActionsListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerParallelDrivingListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.ThreadUtils
@@ -34,7 +34,7 @@ class ParallelDriveView @JvmOverloads constructor(
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener,
IMoGoAutopilotActionsListener, IMoGoParallelDrivingStatusListener {
IMoGoParallelDrivingActionsListener, IMoGoParallelDrivingStatusListener {
companion object {
private const val TAG = "ParallelDriveView"
private const val APP_REQUESTING = 1
@@ -66,8 +66,8 @@ class ParallelDriveView @JvmOverloads constructor(
super.onAttachedToWindow()
initView()
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
CallerAutopilotActionsListenerManager.addListener(TAG, this)
CallerParallelDrivingListenerManager.addListener(TAG, this)
CallerParallelDrivingActionsListenerManager.addListener(TAG, this)
}
private fun initView() {
@@ -119,13 +119,11 @@ class ParallelDriveView @JvmOverloads constructor(
}
}
override fun onAutopilotAbility(
isAutopilotAbility: Boolean,
unableAutopilotReasons: ArrayList<UnableLaunchReason>?
override fun onParallelDrivingAbility(
isParallelDrivingAbility: Boolean,
unableParallelDrivingReasons: ArrayList<UnableLaunchReason>?
) {
// 是否可平行驾驶
val isAvailable = isAvailable(unableAutopilotReasons)
if (!isAvailable) {
if (!isParallelDrivingAbility) {
ThreadUtils.runOnUiThread({
updateUI(UNAVAILABLE)
}, ThreadUtils.MODE.QUEUE)
@@ -317,7 +315,7 @@ class ParallelDriveView @JvmOverloads constructor(
}
private fun checkAvailableAndUpdateUI() {
if (isAvailable(getUnableAutopilotReasons())) {
if (CallerParallelDrivingActionsListenerManager.isParallelDrivingAbility()) {
state = 0
updateUI(0)
} else {
@@ -329,7 +327,7 @@ class ParallelDriveView @JvmOverloads constructor(
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerAutoPilotStatusListenerManager.removeListener(TAG)
CallerAutopilotActionsListenerManager.removeListener(TAG)
CallerParallelDrivingListenerManager.removeListener(TAG)
CallerParallelDrivingActionsListenerManager.removeListener(TAG)
}
}