[6.4.0][启自驾指引][埋点] 添加来源字段

This commit is contained in:
renwj
2024-05-06 16:50:28 +08:00
parent 66036e8206
commit 02a2e411b9
12 changed files with 28 additions and 27 deletions

View File

@@ -168,7 +168,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
});
initListener();
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener() {
@Override
@@ -437,7 +437,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
ctvAutopilotStatus.setClickable(false);
// ctvAutopilotStatus.setSelected(false);
}
UiThreadHandler.postDelayed(() -> setAutopilotBtnStatus(autopilotStatus,CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false)), 1000);
UiThreadHandler.postDelayed(() -> setAutopilotBtnStatus(autopilotStatus,CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0)), 1000);
}
private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning, boolean canStartAutopilt) {

View File

@@ -617,7 +617,7 @@ public class OrderModel {
return;
}
//2、6个条件判断
if (!CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(true)) {
if (!CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(true, 0)) {
return;
}

View File

@@ -186,13 +186,13 @@ public class BusPresenter extends Presenter<BusFragment>
return;
}
// 改变UI自动驾驶状态
runOnUIThread(() -> mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false)));
runOnUIThread(() -> mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0)));
break;
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
OrderModel.getInstance().triggerStartServiceEvent(
OrderModel.getInstance().isRestartAutopilot(), true);
// 改变UI自动驾驶状态
runOnUIThread(() -> mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false)));
runOnUIThread(() -> mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0)));
break;
default:
runOnUIThread(() -> mView.onAutopilotEnableChange(false));
@@ -213,7 +213,7 @@ public class BusPresenter extends Presenter<BusFragment>
//中间站点再次开启自驾时, 自动驾驶状态是2未改变 此次鹰眼底层不再返给业务,需优化按钮动画显示
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
== CallerAutoPilotStatusListenerManager.INSTANCE.getState()){
mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}

View File

@@ -161,7 +161,7 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
initListener();
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),
CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener() {
@Override
@@ -441,7 +441,7 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {
setAutopilotBtnStatus(autopilotStatus,CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
setAutopilotBtnStatus(autopilotStatus,CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}, 1000);
}

View File

@@ -857,7 +857,7 @@ public class TaxiModel {
CallerLogger.d(M_TAXI + TAG, "setIPCDemoModefalse");
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);
if (mADASStatusCallback != null) {
mADASStatusCallback.updateAutopilotStatus(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
mADASStatusCallback.updateAutopilotStatus(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}
@@ -938,7 +938,7 @@ public class TaxiModel {
return;
}
//2、6个条件判断
if (!CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(true)) {
if (!CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(true, 0)) {
return;
}
@@ -1226,7 +1226,7 @@ public class TaxiModel {
public void onAutopilotStatusResponse(int state) {
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
if (mADASStatusCallback != null) {
mADASStatusCallback.onAutopilotRunning(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
mADASStatusCallback.onAutopilotRunning(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
if (mCurrentOCHOrder != null
&& TaxiOrderStatusEnum.OnTheWayToEnd.getCode() == mCurrentOCHOrder.orderStatus) {
@@ -1249,7 +1249,7 @@ public class TaxiModel {
return;
}
if (mADASStatusCallback != null) {
mADASStatusCallback.onAutopilotEnable(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
mADASStatusCallback.onAutopilotEnable(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
if (FunctionBuildConfig.isDemoMode
@@ -1260,7 +1260,7 @@ public class TaxiModel {
return;
}
if (mADASStatusCallback != null) {
mADASStatusCallback.onAutopilotDisable(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
mADASStatusCallback.onAutopilotDisable(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
} else if (state == IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING) {
if (FunctionBuildConfig.isDemoMode) {
@@ -1270,13 +1270,13 @@ public class TaxiModel {
// 当美化模式演示模式开启时且有订单、且为去往目的地状态维持自动驾驶icon开启状态
} else { //美化模式下没订单,显示人工驾驶
if (mADASStatusCallback != null) {
mADASStatusCallback.onAutopilotDisable(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
mADASStatusCallback.onAutopilotDisable(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}
return;
}
if (mADASStatusCallback != null) {
mADASStatusCallback.onManMachineCoDriving(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
mADASStatusCallback.onManMachineCoDriving(CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}
}

View File

@@ -178,7 +178,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
return false;
});
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
// 模拟 不可自动驾驶目前场景是刚开机adas还未和工控机连接
findViewById(R.id.btnAutopilotDisable).setOnClickListener(view ->
@@ -384,7 +384,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
@Override
public void run() {
startOrStopLoadingAnim(false);
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false));
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}, 1000L);
}

View File

@@ -553,8 +553,8 @@ class DevaToolsProvider : IDevaToolsProvider, IAppStateListener {
group.addView(child, ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT))
}
override fun getExceptionStatusBeforeLaunchAutopilot(): Int {
return StatusManager.getExceptionStatusBeforeLaunchAutopilot()
override fun getExceptionStatusBeforeLaunchAutopilot(source: Int): Int {
return StatusManager.getExceptionStatusBeforeLaunchAutopilot(source)
}
override fun registerRouteDownloadListener(tag: String, block: (state: Int) -> Unit) {

View File

@@ -248,7 +248,7 @@ internal class MoFangCommandExecutor {
if (AppIdentityModeUtils.isSweeper(FunctionBuildConfig.appIdentityMode)) {
CallerAutoPilotControlManager.startAutoPilotByMoFang(parameters)
} else {
if (CallerAutoPilotControlManager.isCanStartAutopilot(true)) {
if (CallerAutoPilotControlManager.isCanStartAutopilot(true, -1)) {
CallerAutoPilotControlManager.startAutoPilot(parameters)
}
}

View File

@@ -184,7 +184,7 @@ object StatusManager {
listeners.remove(tag)
}
fun getExceptionStatusBeforeLaunchAutopilot(): Int {
fun getExceptionStatusBeforeLaunchAutopilot(source: Int): Int {
if (!hasInit) {
return 0
}
@@ -202,6 +202,7 @@ object StatusManager {
"vehicle_start_autopilot_state_check",
HashMap<String, Any>().also { itx ->
itx["time"] = time
itx["src"] = source
itx["desc"] = ll.joinToString(",") { item ->
when (item) {
is SteerStatus -> "方向盘"

View File

@@ -302,7 +302,7 @@ interface IDevaToolsProvider : IProvider {
fun attachAutopilotStatusView(ctx: Context, group: ViewGroup)
fun getExceptionStatusBeforeLaunchAutopilot(): Int
fun getExceptionStatusBeforeLaunchAutopilot(source: Int): Int
fun registerRouteDownloadListener(tag: String, block:(state: Int) -> Unit)

View File

@@ -84,9 +84,9 @@ object CallerAutoPilotControlManager {
/**
* 启自驾前,是否要拦截
* @param isShowTip true: 展示Toast+语音提示; false:不展示Toast+语音提示
*
* @param source -1: 蘑方发出启自驾前状态拦截;>=0 用于其它场景的判断
*/
fun isCanStartAutopilot(isShowTip: Boolean): Boolean {
fun isCanStartAutopilot(isShowTip: Boolean, source: Int = 0): Boolean {
/**
* 方向盘: 1<<0
* 油门 : 1<<1
@@ -95,7 +95,7 @@ object CallerAutoPilotControlManager {
* 档位: 1<<4
* 轨迹下载: (下载中) 1<<5 下载失败1<<6
*/
val exceptionValue = CallerDevaToolsManager.getExceptionStatusBeforeLaunchAutopilot()
val exceptionValue = CallerDevaToolsManager.getExceptionStatusBeforeLaunchAutopilot(source)
if (exceptionValue != 0) {
if (isShowTip) {
val sb = StringBuilder("请检查车辆")

View File

@@ -379,8 +379,8 @@ object CallerDevaToolsManager {
devaToolsProviderApi?.unRegisterRouteDownloadListener(tag)
}
fun getExceptionStatusBeforeLaunchAutopilot(): Int {
return devaToolsProviderApi?.getExceptionStatusBeforeLaunchAutopilot() ?: 0
fun getExceptionStatusBeforeLaunchAutopilot(source: Int): Int {
return devaToolsProviderApi?.getExceptionStatusBeforeLaunchAutopilot(source) ?: 0
}
fun registerStartAutopilotStateListener(tag: String, block: (isCanStartAutopilot: Boolean) -> Unit) {