opt and fixed obu ip bug

This commit is contained in:
lixiaopeng
2022-05-19 11:21:15 +08:00
parent 435e7b37d5
commit d7b4689ff0
8 changed files with 32 additions and 35 deletions

View File

@@ -59,32 +59,17 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
*/
@Override
public void getBindingcarInfo(String macAddress, String widevineIDWithMd5) {
Log.d("liyz", "getBindingcarInfo ---1--- mAddress = " + mAddress + "--mWidevineIDWithMd5 = " + mWidevineIDWithMd5 + "--mScreenType = " + mScreenType);
if (!TextUtils.isEmpty(macAddress)) { //司机
mAddress = macAddress;
} else {
//乘客
mAddress = SharedPrefsMgr.getInstance(mContext).getString(SharedPrefsConstants.MAC_ADDRESS);
}
//widevineIDWithMd5
if (!TextUtils.isEmpty(widevineIDWithMd5)) { //乘客
mWidevineIDWithMd5 = widevineIDWithMd5;
mScreenType = 2;
} else { //司机
mWidevineIDWithMd5 = MoGoAiCloudClientConfig.getInstance().getSn();
mScreenType = 1;
}
Log.d("liyz", "getBindingcarInfo ---2--- mAddress = " + mAddress + "--mWidevineIDWithMd5 = " + mWidevineIDWithMd5 + "--mScreenType = " + mScreenType);
mAddress = macAddress;
mWidevineIDWithMd5 = widevineIDWithMd5;
Log.d("liyz", "getBindingcarInfo ------ mAddress = " + mAddress + "--mWidevineIDWithMd5 = " + mWidevineIDWithMd5 + "--getScreenType() = " + getScreenType());
if (HmiBuildConfig.isShowSnBindingView) {
BindingcarNetWorkManager.getInstance().getBindingcarInfo(mContext, macAddress, mWidevineIDWithMd5, mScreenType);
BindingcarNetWorkManager.getInstance().getBindingcarInfo(mContext, macAddress, mWidevineIDWithMd5, getScreenType());
}
}
@Override
public void modifyCarInfo(BindingcarCallBack callBack) {
BindingcarNetWorkManager.getInstance().modifyBindingcar(mAddress, mWidevineIDWithMd5,callBack, mScreenType);
BindingcarNetWorkManager.getInstance().modifyBindingcar(mAddress, mWidevineIDWithMd5, callBack, getScreenType());
}

View File

@@ -52,14 +52,13 @@ public class BindingcarNetWorkManager {
/**
* 获取绑定的车辆信息 TODO
* 获取绑定的车辆信息
*
* @param macAddress mac地址
*/
public void getBindingcarInfo(Context context, String macAddress, String widevineIDWithMd5, int screenType) {
// String macAddress = "48:b0:2d:3a:bc:78";
// String sn = "X20202203105S688HZ";
// int screenType = 1;
Log.d("liyz", "getBindingcarInfo -- widevineIDWithMd5 = " + widevineIDWithMd5 + "--macAddress = " +macAddress + "--screenType = " + screenType);
BindingcarRequest request = new BindingcarRequest(macAddress, widevineIDWithMd5, screenType);
@@ -77,9 +76,9 @@ public class BindingcarNetWorkManager {
if (info != null && info.getData() != null) {
CallerLogger.INSTANCE.d(TAG, "getBindingcarInfo onNext info.getData() =" + info.getData().toString());
Log.d("liyz", "getBindingcarInfo onNext info.getData() =" + info.getData().toString() + "--compare = " + info.getData().getCompare());
if (info.getData().getCompare().equals(0)) {
if (info.getData().getCompare().equals("0")) {
CallerHmiManager.INSTANCE.showBindingcarDialog();
} else if (info.getData().getCompare().equals(3)) {
} else if (info.getData().getCompare().equals("3")) {
CallerHmiManager.INSTANCE.showModifyBindingcarDialog();
}
@@ -105,7 +104,6 @@ public class BindingcarNetWorkManager {
* mac: 48:b0:2d:3a:9c:19
*/
public void modifyBindingcar(String macAddress, String widevineIDWithMd5, BindingcarCallBack callBack, int screenType) {
// String sn = MoGoAiCloudClientConfig.getInstance().getSn();
Log.d("liyz", "modifyBindingcar --- widevineIDWithMd5 = " + widevineIDWithMd5 + "---macAddress = " + macAddress + "--screenType = " + screenType);
BindingcarRequest request = new BindingcarRequest(macAddress, widevineIDWithMd5, screenType);
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));