opt
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
package com.mogo.eagle.core.function.bindingcar;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.constants.SharedPrefsConstants;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
@@ -11,6 +16,8 @@ import com.mogo.eagle.core.function.api.bindingcar.IMoGoBindingcarProvider;
|
||||
import com.mogo.eagle.core.function.bindingcar.network.BindingcarNetWorkManager;
|
||||
import com.mogo.eagle.core.function.ipcupgrade.IPCUpgradeManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.DeviceIdUtils;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -25,6 +32,8 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
|
||||
|
||||
private Context mContext;
|
||||
private volatile String mAddress;
|
||||
private volatile String mWidevineIDWithMd5; //google 数字版权
|
||||
private volatile int mScreenType = -1;
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
@@ -49,16 +58,33 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
|
||||
* @param macAddress
|
||||
*/
|
||||
@Override
|
||||
public void getBindingcarInfo(String macAddress) {
|
||||
mAddress = macAddress;
|
||||
if (HmiBuildConfig.isShowSnBindingView) { //TODO 需要验证
|
||||
// BindingcarNetWorkManager.getInstance().getBindingcarInfo(mContext, macAddress, getScreenType());
|
||||
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);
|
||||
if (HmiBuildConfig.isShowSnBindingView) {
|
||||
BindingcarNetWorkManager.getInstance().getBindingcarInfo(mContext, macAddress, mWidevineIDWithMd5, mScreenType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyCarInfo(BindingcarCallBack callBack) {
|
||||
// BindingcarNetWorkManager.getInstance().modifyBindingcar(mAddress, callBack, getScreenType());
|
||||
BindingcarNetWorkManager.getInstance().modifyBindingcar(mAddress, mWidevineIDWithMd5,callBack, mScreenType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,11 +3,8 @@ 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.AbsMogoApplication;
|
||||
import com.mogo.commons.constants.SharedPrefsConstants;
|
||||
import com.mogo.eagle.core.data.bindingcar.BindingcarInfo;
|
||||
import com.mogo.eagle.core.data.bindingcar.CarInfo;
|
||||
import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo;
|
||||
import com.mogo.eagle.core.function.api.bindingcar.BindingcarCallBack;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
@@ -15,7 +12,6 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.DeviceIdUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
|
||||
@@ -39,7 +35,7 @@ public class BindingcarNetWorkManager {
|
||||
private static final String TAG = "BindingcarNetWorkManager";
|
||||
|
||||
private BindingcarNetWorkManager() {
|
||||
mBindingcarApiService = MoGoRetrofitFactory.getInstance(HostConst.BINDING_SN_HOST_TEST)
|
||||
mBindingcarApiService = MoGoRetrofitFactory.getInstance(HostConst.BINDING_SN_HOST_TEST) //TODO
|
||||
.create(BindingcarApiService.class);
|
||||
}
|
||||
|
||||
@@ -60,14 +56,13 @@ public class BindingcarNetWorkManager {
|
||||
*
|
||||
* @param macAddress mac地址
|
||||
*/
|
||||
public void getBindingcarInfo(Context context, String macAddress1, int screenType1) {
|
||||
// String sn = DeviceIdUtils.getWidevineIDWithMd5(AbsMogoApplication.getApp());
|
||||
String macAddress = "48:b0:2d:3a:bc:7";
|
||||
String sn = "X20202203105S688HZ";
|
||||
int screenType = 1;
|
||||
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 -- sn = " + sn + "--macAddress = " +macAddress + "--screenType = " + screenType);
|
||||
BindingcarRequest request = new BindingcarRequest(macAddress, sn, screenType);
|
||||
Log.d("liyz", "getBindingcarInfo -- 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));
|
||||
mBindingcarApiService.getBindingcarInfo(token, requestBody)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -109,11 +104,10 @@ public class BindingcarNetWorkManager {
|
||||
* 绑定和修改绑定车辆
|
||||
* mac: 48:b0:2d:3a:9c:19
|
||||
*/
|
||||
public void modifyBindingcar(String macAddress, BindingcarCallBack callBack, int screenType) {
|
||||
public void modifyBindingcar(String macAddress, String widevineIDWithMd5, BindingcarCallBack callBack, int screenType) {
|
||||
// String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
String sn = DeviceIdUtils.getWidevineIDWithMd5(AbsMogoApplication.getApp());
|
||||
Log.d("liyz", "modifyBindingcar --- sn = " + sn + "---macAddress = " + macAddress);
|
||||
BindingcarRequest request = new BindingcarRequest(macAddress, sn, screenType);
|
||||
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));
|
||||
mBindingcarApiService.modifyBindingcarInfo(token, requestBody)
|
||||
.subscribeOn(Schedulers.io())
|
||||
|
||||
Reference in New Issue
Block a user