Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0
# Conflicts: # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/BaseSweeperTabFragment.java # app_ipc_monitoring/src/main/java/com/zhidao/adas/client/DataDistribution.java # app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java
This commit is contained in:
@@ -56,6 +56,7 @@ import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
|
||||
@@ -320,6 +321,10 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBagManagerResult(@NonNull BagManagerOuterClass.BagManager bagManager) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试到站
|
||||
*/
|
||||
@@ -428,8 +433,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
}
|
||||
|
||||
private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "onStateChangeChangeAutopilotBtnView: "
|
||||
+ autopilotStatus + "isAnimateRunning = " + isAnimateRunning);
|
||||
if (isAnimateRunning && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
!= autopilotStatus) {
|
||||
// 主动开启自动驾驶中,不为2(为0、1)则继续loading
|
||||
|
||||
@@ -71,6 +71,4 @@ dependencies {
|
||||
api project(':core:function-impl:mogo-core-function-map')
|
||||
}
|
||||
|
||||
compileOnly project(':libraries:mogo-adas')
|
||||
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.mogo.och.common.module.manager
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Context
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
@@ -17,6 +16,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
@@ -26,26 +26,40 @@ object AbnormalFactorsLoopManager : IMogoStatusChangedListener {
|
||||
|
||||
const val TAG = "AbnormalFactorsLoopManager"
|
||||
|
||||
private const val LOOP_TIME = 10 *1000L
|
||||
private const val LOOP_TIME = 10 * 1000L
|
||||
private const val LOOP_DELAY = 5 * 1000L
|
||||
private var socketStatus: Boolean = false
|
||||
private var socketStatus by Delegates.observable(false) { _, _, newValue ->
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
return@observable
|
||||
}
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
return@observable
|
||||
}
|
||||
if (newValue) {
|
||||
ToastUtils.showLong("长链接状态恢复")
|
||||
} else {
|
||||
ToastUtils.showLong("长链接异常,请开启相应权限或者查看网络")
|
||||
}
|
||||
}
|
||||
|
||||
private var looperDisposable : Disposable? = null
|
||||
private var looperDisposable: Disposable? = null
|
||||
|
||||
fun startLoopAbnormalFactors(context: Context){
|
||||
if (looperDisposable != null && !looperDisposable!!.isDisposed){
|
||||
fun startLoopAbnormalFactors(context: Context) {
|
||||
if (looperDisposable != null && !looperDisposable!!.isDisposed) {
|
||||
return
|
||||
}
|
||||
i(TAG, "startLoopAbnormalFactors()")
|
||||
looperDisposable = Observable.interval(LOOP_DELAY, LOOP_TIME, TimeUnit.MILLISECONDS)
|
||||
.map { aLong -> aLong+1 }
|
||||
.map { aLong -> aLong + 1 }
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe{ aLong -> checkAbnormalFactors(context)}
|
||||
.subscribe { aLong -> checkAbnormalFactors(context) }
|
||||
|
||||
//长链接监听
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG,
|
||||
StatusDescriptor.CLOUD_SOCKET,this)
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.CLOUD_SOCKET, this
|
||||
)
|
||||
}
|
||||
|
||||
private fun checkAbnormalFactors(context: Context) {
|
||||
@@ -54,14 +68,15 @@ object AbnormalFactorsLoopManager : IMogoStatusChangedListener {
|
||||
var networkStatus = false
|
||||
|
||||
//定位权限
|
||||
locationStatusPermsStatus = !(!PermissionUtil.isLocServiceEnable(context) || !PermissionUtil.checkPermission(
|
||||
context, *arrayOf(
|
||||
Manifest.permission.ACCESS_FINE_LOCATION
|
||||
)
|
||||
))
|
||||
locationStatusPermsStatus =
|
||||
!(!PermissionUtil.isLocServiceEnable(context) || !PermissionUtil.checkPermission(
|
||||
context, *arrayOf(
|
||||
Manifest.permission.ACCESS_FINE_LOCATION
|
||||
)
|
||||
))
|
||||
|
||||
//网络状态或者网络权限是否打开
|
||||
if (NetworkUtils.isConnected(context)){
|
||||
if (NetworkUtils.isConnected(context)) {
|
||||
networkStatus = true
|
||||
}
|
||||
//长链接状态 socketStatus
|
||||
@@ -70,28 +85,27 @@ object AbnormalFactorsLoopManager : IMogoStatusChangedListener {
|
||||
if (!locationStatusPermsStatus) toastStr += "定位服务异常 "
|
||||
if (!networkStatus) toastStr += " 网络异常 "
|
||||
|
||||
//乘客屏不显示长链接异常
|
||||
if (!socketStatus && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) toastStr += " 长链接异常 "
|
||||
|
||||
i(TAG, "abnormal_factors_Str = $toastStr")
|
||||
|
||||
if (!FunctionBuildConfig.isDemoMode && toastStr !== ""){
|
||||
if (!FunctionBuildConfig.isDemoMode && toastStr !== "") {
|
||||
ToastUtils.showLong(toastStr + "请开启相应权限或者查看网络")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun stopLoopAbnormalFactors(){
|
||||
fun stopLoopAbnormalFactors() {
|
||||
looperDisposable!!.dispose()
|
||||
looperDisposable == null
|
||||
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG,
|
||||
StatusDescriptor.CLOUD_SOCKET,this)
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.CLOUD_SOCKET, this
|
||||
)
|
||||
}
|
||||
|
||||
override fun onStatusChanged(descriptor: StatusDescriptor?, isTrue: Boolean) {
|
||||
//长链接监听、
|
||||
if (StatusDescriptor.CLOUD_SOCKET == descriptor){
|
||||
if (StatusDescriptor.CLOUD_SOCKET == descriptor) {
|
||||
socketStatus = isTrue
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,9 @@ import java.util.List;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
|
||||
/**
|
||||
* 网约车基础Fragment,主要负责布局通用界面,处理站点面板和通话面板互斥情况
|
||||
@@ -222,6 +225,26 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRecordResult(@Nullable RecordPanelOuterClass.RecordPanel recordPanel) {
|
||||
// if (!HmiBuildConfig.isShowBadCaseView && recordPanel != null && recordPanel.getType() == 1 && recordPanel.getStat() == 100) {
|
||||
// CallerDevaToolsManager.INSTANCE.onReceiveBadCaseRecord(recordPanel);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBagManagerResult(@NonNull BagManagerOuterClass.BagManager bagManager) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试到站
|
||||
*/
|
||||
protected abstract void debugArrivedStation();
|
||||
|
||||
private void initListener() {
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().registerHostMapListener(TAG, this);
|
||||
mCloseNavIcon.setOnClickListener(this);
|
||||
|
||||
@@ -53,6 +53,7 @@ import com.mogo.och.taxi.R;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
|
||||
@@ -386,6 +387,10 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBagManagerResult(@NonNull BagManagerOuterClass.BagManager bagManager) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 改变自动驾驶状态
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user