[3.2.0][应用升级] 优化代码逻辑
This commit is contained in:
@@ -42,6 +42,9 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
|
|||||||
@Volatile
|
@Volatile
|
||||||
private var mAddress: String? = null
|
private var mAddress: String? = null
|
||||||
|
|
||||||
|
@Volatile
|
||||||
|
private var mObuVersion: String? = null
|
||||||
|
|
||||||
@Volatile
|
@Volatile
|
||||||
private var mWidevineIDWithMd5 //google 数字版权
|
private var mWidevineIDWithMd5 //google 数字版权
|
||||||
: String? = null
|
: String? = null
|
||||||
@@ -65,8 +68,20 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
|
|||||||
if (!TextUtils.isEmpty(carConfigResp.macAddress)) {
|
if (!TextUtils.isEmpty(carConfigResp.macAddress)) {
|
||||||
Logger.d("${SceneConstant.M_BINDING}${TAG}",
|
Logger.d("${SceneConstant.M_BINDING}${TAG}",
|
||||||
"onAutopilotCarConfig carConfigResp.macAddress = ${carConfigResp.macAddress} ")
|
"onAutopilotCarConfig carConfigResp.macAddress = ${carConfigResp.macAddress} ")
|
||||||
|
var flag = false
|
||||||
|
if (mAddress.isNullOrEmpty()) {
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
Logger.d("${SceneConstant.M_BINDING}${TAG}",
|
||||||
|
"onAutopilotCarConfig - triggerUpgrade -> $flag")
|
||||||
getBindingCarInfo(carConfigResp.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
|
getBindingCarInfo(carConfigResp.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
|
||||||
queryAppUpgrade()
|
if (flag) {
|
||||||
|
queryAppUpgrade()
|
||||||
|
val obuVersion = mObuVersion
|
||||||
|
if (obuVersion != null) {
|
||||||
|
queryObuUpgrade(obuVersion)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,12 +197,12 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
|
|||||||
* obu的升级,只需要司机屏连接
|
* obu的升级,只需要司机屏连接
|
||||||
*/
|
*/
|
||||||
fun queryObuUpgrade(obuVersionName: String) {
|
fun queryObuUpgrade(obuVersionName: String) {
|
||||||
|
mObuVersion = obuVersionName
|
||||||
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}", "screenType = $screenType ----role = $role")
|
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}", "screenType = $screenType ----role = $role")
|
||||||
if (screenType == 1) {
|
if (screenType == 1) {
|
||||||
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}","queryObuUpgrade isConnected = ${CallerObuApiManager.isConnected()} --- mAddress = $mAddress")
|
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}","queryObuUpgrade isConnected = ${CallerObuApiManager.isConnected()} --- mAddress = $mAddress")
|
||||||
ObuUpgradeAppNetWorkManager.instance?.getObuUpgradeInfo(mContext, if(!mAddress.isNullOrEmpty()) mAddress else SharedPrefsMgr.getInstance(mContext!!).getString(SharedPrefsConstants.APP_MAC), obuVersionName)
|
ObuUpgradeAppNetWorkManager.instance?.getObuUpgradeInfo(mContext, if(!mAddress.isNullOrEmpty()) mAddress else SharedPrefsMgr.getInstance(mContext!!).getString(SharedPrefsConstants.APP_MAC), obuVersionName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user