diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeAppNetWorkManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeAppNetWorkManager.kt index d8238e6454..3441b67815 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeAppNetWorkManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeAppNetWorkManager.kt @@ -17,6 +17,7 @@ import com.mogo.eagle.core.network.utils.* import com.mogo.eagle.core.utilcode.breakpoint.Config import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d import com.mogo.eagle.core.utilcode.mogo.logger.scene.* +import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr import com.mogo.eagle.core.utilcode.util.* import com.mogo.eagle.core.utilcode.util.FileUtils import kotlinx.coroutines.* @@ -44,6 +45,8 @@ class UpgradeAppNetWorkManager private constructor() { val sn = MoGoAiCloudClientConfig.getInstance().sn //null val macAddress = mac //"48:b0:2d:4d:31:7f" val type = screenType //10 + SharedPrefsMgr.getInstance(context!!).putString(SharedPrefsConstants.HOST_ADDRESS, HostConst.getHost()) + try { val records = provider?.getUpgradeRecords()?.also { MogoAnalyticUtils.track("AppUpgradeRecord", it.let { TreeMap().also { itx -> itx.putAll(it) } }) @@ -57,6 +60,11 @@ class UpgradeAppNetWorkManager private constructor() { provider?.recordUpgradeRecord(sn ?: "", macAddress, type, FunctionBuildConfig.isSupportPatchUpgrade) provider?.recordUpgradeRequestStart() val info = mUpgradeApiService.getUpgradeInfo(requestBody) + if (info != null) { + SharedPrefsMgr.getInstance(context!!).putString(SharedPrefsConstants.APP_UPGRADE_CONTENT, if (info.result != null) GsonUtils.toJson(info) + "--mac:$macAddress --type:$type --sn:$sn --versionName:$versionName" else "info.result == null --mac:$macAddress --type:$type --sn:$sn --versionName:$versionName") + } else { + SharedPrefsMgr.getInstance(context!!).putString(SharedPrefsConstants.APP_UPGRADE_CONTENT, "info == null --mac:$macAddress --type:$type --sn:$sn --versionName:$versionName") + } if (info.result != null) { provider?.recordUpgradeRequestSuccess(GsonUtils.toJson(info)) doUpgrade(info) @@ -65,6 +73,9 @@ class UpgradeAppNetWorkManager private constructor() { } } catch (t: Throwable) { t.printStackTrace() + SharedPrefsMgr.getInstance(context!!).putString(SharedPrefsConstants.APP_UPGRADE_CONTENT, + "$t--mac:$macAddress --type:$type --sn:$sn " + ) provider?.recordUpgradeRequestFailed(t.message ?: "更新接口请求失败") deleteApkFile() } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index e66129655d..196240bea3 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -309,6 +309,9 @@ internal class DebugSettingView @JvmOverloads constructor( } } + /** + * 蘑方点击事件 + */ tbMojie.setOnCheckedChangeListener { buttonView, isChecked -> if (isChecked) { buttonView.setCompoundDrawables(null, null, iconDown, null) @@ -319,6 +322,21 @@ internal class DebugSettingView @JvmOverloads constructor( } } + /** + * APP升级点击事件 + */ + tbAppUpgrade.setOnCheckedChangeListener { buttonView, isChecked -> + if (isChecked) { + buttonView.setCompoundDrawables(null, null, iconDown, null) + tvAppHost.visibility = View.VISIBLE + tvAppContent.visibility = View.VISIBLE + } else { + buttonView.setCompoundDrawables(null, null, iconRight, null) + tvAppHost.visibility = View.GONE + tvAppContent.visibility = View.GONE + } + } + /** * 蘑方控制 默认关闭 */ @@ -1619,6 +1637,10 @@ internal class DebugSettingView @JvmOverloads constructor( } tvCmdbCarInfoContent.text = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO)?:"" + //APP升级功能 + tvAppHost.text = "HOST地址:" + SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.HOST_ADDRESS)?:"" + tvAppContent.text = "APP升级数据:" + SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.APP_UPGRADE_CONTENT)?:"" + tvCarInfo.text = "GPS时间:${(mGnssInfo?.satelliteTime?.times(1000))?.toLong()}\n" + "自车经纬度:\n${mGnssInfo?.longitude}\n${mGnssInfo?.latitude}\n" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml index eb5a459ae3..9e8693ce0e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml @@ -289,6 +289,7 @@ android:textOn="关闭obu预警融合" android:textSize="@dimen/dp_24" /> + + android:scaleX="1" /> + + + + + + + + +