[2.13.0-arch-opt] binding car add config

This commit is contained in:
zhongchao
2023-02-14 18:50:40 +08:00
parent f0f3d26cbb
commit 32991f784d
13 changed files with 42 additions and 15 deletions

View File

@@ -115,7 +115,7 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
SharedPrefsMgr.getInstance(mContext!!)
.putLong("typeDriver", System.currentTimeMillis() / (1000 * 60))
BindingCarNetWorkManager.instance
.getBindingcarInfo(mContext, macAddress, widevineIDWithMd5, screenType)
.getBindingCarInfo(mContext!!, macAddress, widevineIDWithMd5, screenType)
}
}
}
@@ -131,7 +131,7 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
SharedPrefsMgr.getInstance(mContext!!)
.putLong("typePassenger", System.currentTimeMillis() / (1000 * 60))
BindingCarNetWorkManager.instance
.getBindingcarInfo(mContext, macAddress, widevineIDWithMd5, screenType)
.getBindingCarInfo(mContext!!, macAddress, widevineIDWithMd5, screenType)
}
}
}//乘客屏//司机屏

View File

@@ -3,6 +3,7 @@ package com.zhjt.mogo_core_function_devatools.binding
import android.content.Context
import com.mogo.commons.constants.HostConst
import com.mogo.commons.constants.SharedPrefsConstants
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.bindingcar.BindingCarInfo
import com.mogo.eagle.core.data.bindingcar.BindingCarRequest
import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo
@@ -40,16 +41,17 @@ class BindingCarNetWorkManager private constructor() {
}
}
private val mBindingCarApiService: BindingCarApiService = MoGoRetrofitFactory.getInstance(HostConst.getHost())
.create(BindingCarApiService::class.java)
private val mBindingCarApiService: BindingCarApiService =
MoGoRetrofitFactory.getInstance(HostConst.getHost())
.create(BindingCarApiService::class.java)
/**
* 获取绑定的车辆信息
*
* @param macAddress mac地址
*/
fun getBindingcarInfo(
context: Context?,
fun getBindingCarInfo(
context: Context,
macAddress: String?,
widevineIDWithMd5: String?,
screenType: Int
@@ -72,10 +74,10 @@ class BindingCarNetWorkManager private constructor() {
override fun onSubscribe(d: Disposable) {}
override fun onNext(info: BindingCarInfo) {
if (info != null && info.getData() != null) {
d(
SceneConstant.M_BINDING + TAG,
"getBindingcarInfo onNext info.getData() =" + info.getData().toString()
)
d(SceneConstant.M_BINDING + TAG, "getBindingcarInfo data =" + info.getData().toString())
if (!SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.MAC_ADDRESS).equals(macAddress) && DebugConfig.isCarModelChange()) {
updateCarVrIconRes(info.getData().brandId);
}
//根据车辆类型切换不同的车辆模型,只针对红旗做处理
updateCarVrIconRes(info.getData().brandId)
when (info.getData().compare) {
@@ -83,10 +85,8 @@ class BindingCarNetWorkManager private constructor() {
"3" -> showModifyBindingCarDialog()
"null" -> TipToast.shortTip("当前工控机没有入库")
}
SharedPrefsMgr.getInstance(context!!).putString(
SharedPrefsConstants.CAR_INFO,
GsonUtils.toJson(info.getData())
)
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, GsonUtils.toJson(info.getData()))
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.MAC_ADDRESS, macAddress)
}
}