Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0
This commit is contained in:
@@ -101,7 +101,7 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
}
|
||||
|
||||
fun modifyCarInfo(callBack: (ModifyBindingcarInfo) -> Unit) {
|
||||
BindingCarNetWorkManager.instance.modifyBindingcar(mAddress, mWidevineIDWithMd5, callBack, screenType)
|
||||
BindingCarNetWorkManager.instance.modifyBindingCar(mContext!!, mAddress, mWidevineIDWithMd5, callBack, screenType)
|
||||
}
|
||||
|
||||
private fun driverScreen(macAddress: String, widevineIDWithMd5: String) {
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}//乘客屏//司机屏
|
||||
|
||||
@@ -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,28 +74,24 @@ 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()
|
||||
)
|
||||
//根据车辆类型切换不同的车辆模型,只针对红旗做处理
|
||||
updateCarVrIconRes(info.getData().brandId)
|
||||
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);
|
||||
}
|
||||
when (info.getData().compare) {
|
||||
"0" -> showBindingCarDialog()
|
||||
"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)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
e(
|
||||
SceneConstant.M_BINDING + TAG,
|
||||
"getBindingcarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message
|
||||
"getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message
|
||||
)
|
||||
}
|
||||
|
||||
@@ -105,7 +103,8 @@ class BindingCarNetWorkManager private constructor() {
|
||||
* 绑定和修改绑定车辆
|
||||
* mac: 48:b0:2d:3a:9c:19
|
||||
*/
|
||||
fun modifyBindingcar(
|
||||
fun modifyBindingCar(
|
||||
context: Context,
|
||||
macAddress: String?,
|
||||
widevineIDWithMd5: String?,
|
||||
callBack: (ModifyBindingcarInfo) -> Unit,
|
||||
@@ -132,16 +131,19 @@ class BindingCarNetWorkManager private constructor() {
|
||||
callBack.invoke(info)
|
||||
d(
|
||||
SceneConstant.M_BINDING + TAG,
|
||||
"modifyBindingcar onNext code = " + info.code + "---msg = " + info.msg + "--info.toString() = " + info.toString()
|
||||
"modifyBindingCar onNext code = " + info.code + "---msg = " + info.msg + "--info.toString() = " + info.toString()
|
||||
)
|
||||
updateCarVrIconRes(info.data.brandId)
|
||||
if (!SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.MAC_ADDRESS).equals(macAddress) && DebugConfig.isCarModelChange()) {
|
||||
updateCarVrIconRes(info.data.brandId);
|
||||
}
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.MAC_ADDRESS, macAddress)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
e(
|
||||
SceneConstant.M_BINDING + TAG,
|
||||
"modifyBindingcar onError e = " + e.toString() + "---e.getMessage = " + e.message
|
||||
"modifyBindingCar onError e = " + e.toString() + "---e.getMessage = " + e.message
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user