Merge branch 'dev_robotaxi-d-app-module_265_220329_2.6.5' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_robotaxi-d-app-module_265_220329_2.6.5

This commit is contained in:
wangmingjun
2022-03-30 16:19:28 +08:00
3 changed files with 29 additions and 5 deletions

View File

@@ -137,9 +137,11 @@ public class MoGoHandAdasMsgManager implements
@Override
public void onAutopilotCarConfig(@NotNull MessagePad.CarConfigResp carConfigResp) {
// Log.d("liyz", "onAutopilotCarConfig ----------1-----------");
if (carConfigResp != null && !TextUtils.isEmpty(carConfigResp.getMacAddress())) {
// Log.d("liyz", "onAutopilotCarConfig ----------2-----------" + carConfigResp.getMacAddress() + "--" + carConfigResp.getPlateNumber());
CallerLogger.INSTANCE.d(M_DEVA + TAG, " carConfigResp.getMacAddress() = " + carConfigResp.getMacAddress() + "--mac = " + carConfigResp.getMacAddress().replaceAll(".{2}(?=.)", "$0:"));
CallerBindingcarManager.getBindingcarProvider().getBindingcarInfo(carConfigResp.getMacAddress());
// CallerBindingcarManager.getBindingcarProvider().getBindingcarInfo(carConfigResp.getMacAddress());
}
}

View File

@@ -6,6 +6,7 @@ import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.commons.constants.SharedPrefsConstants;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.function.api.bindingcar.BindingcarCallBack;
import com.mogo.eagle.core.function.api.bindingcar.IMoGoBindingcarProvider;
@@ -50,12 +51,23 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
@Override
public void getBindingcarInfo(String macAddress) {
mAddress = macAddress;
BindingcarNetWorkManager.getInstance().getBindingcarInfo(mContext, macAddress);
BindingcarNetWorkManager.getInstance().getBindingcarInfo(mContext, macAddress, getScreenType());
}
@Override
public void modifyCarInfo(BindingcarCallBack callBack) {
BindingcarNetWorkManager.getInstance().modifyBindingcar(mAddress, callBack);
BindingcarNetWorkManager.getInstance().modifyBindingcar(mAddress, callBack, getScreenType());
}
private int getScreenType () {
int screenType = -1;
if (FunctionBuildConfig.appIdentityMode == 0 || FunctionBuildConfig.appIdentityMode == 0xA0) {
screenType = 1; //司机屏
} else if (FunctionBuildConfig.appIdentityMode == 1 || FunctionBuildConfig.appIdentityMode == 0xA1) {
screenType = 2; //乘客屏
}
return screenType;
}

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.bindingcar.network;
import android.content.Context;
import android.util.Log;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.constants.SharedPrefsConstants;
@@ -55,7 +56,10 @@ public class BindingcarNetWorkManager {
*
* @param macAddress mac地址
*/
public void getBindingcarInfo(Context context, String macAddress) {
public void getBindingcarInfo(Context context, String macAddress, int screenType) {
if (screenType == 2) {
return;
}
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
BindingcarRequest request = new BindingcarRequest(macAddress, sn);
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
@@ -97,7 +101,13 @@ public class BindingcarNetWorkManager {
* 绑定和修改绑定车辆
* mac: 48:b0:2d:3a:9c:19
*/
public void modifyBindingcar(String macAddress, BindingcarCallBack callBack) {
public void modifyBindingcar(String macAddress, BindingcarCallBack callBack, int screenType) {
Log.d("liyz", "modifyBindingcar screenType = " + screenType);
if (screenType == 2) {
return;
}
Log.d("liyz", "modifyBindingcar --------1----------- ");
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
BindingcarRequest request = new BindingcarRequest(macAddress, sn);
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));