[6.8.0][应用升级] 优化mac地址获取逻辑

This commit is contained in:
renwj
2024-11-26 19:40:21 +08:00
parent 9274957d2d
commit 720e7da7a3
2 changed files with 4 additions and 3 deletions

View File

@@ -78,9 +78,6 @@ object BindingCarManager : IMoGoAutopilotCarConfigListener, IMoGoCloudListener {
"${M_DEVA}${TAG}",
"onAutopilotCarConfig carConfigResp.macAddress = ${carConfigResp.macAddress} "
)
if (SharedPrefsMgr.getInstance().sn.isNullOrEmpty()) {
return
}
this.carConfigResp = carConfigResp
getBindingCarInfo(carConfigResp.macAddress, SharedPrefsMgr.getInstance().sn)
}

View File

@@ -95,6 +95,10 @@ class UpgradeAppNetWorkManager private constructor() {
Log.d(TAG, "getAppUpgradeInfo: -> records:" + records?.entries?.joinToString(",") { itx -> "key:${itx.key} -> value:[${itx.value.joinToString(",") { "${it.first},${it.second}" } }]"})
val versionCode = AppUtils.getAppVersionCode()
val versionName = AppUtils.getAppVersionName()
val latestMacAddress = BindingCarManager.getMacAddress()
if (latestMacAddress != null && !TextUtils.equals(latestMacAddress, macAddress)) {
macAddress = latestMacAddress
}
Log.d(SceneConstant.M_DEVA + TAG, "getAppUpgradeInfo mac = $macAddress---type = $type---sn = $sn---versionCode =$versionCode---versionName =$versionName")
val request = UpgradeAppRequest(sn, macAddress, type, versionName, "1")
val requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request))