Merge remote-tracking branch 'origin/2.15.0_merge_master' into dev_minibus-d_230425_3.2.0

This commit is contained in:
renwj
2023-05-17 14:27:03 +08:00
3 changed files with 10 additions and 4 deletions

View File

@@ -43,12 +43,18 @@ class UpgradeAppNetWorkManager private constructor() {
scope.launch {
val sn = MoGoAiCloudClientConfig.getInstance().sn //null
val macAddress = mac //"48:b0:2d:4d:31:7f"
val type = screenType //10
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<String, Any>().also { itx -> itx.putAll(it) } })
MogoAnalyticUtils.track("AppUpgradeRecord", TreeMap<String, Any>().also { itx ->
it.entries.forEach { entry ->
itx[entry.key] = entry.value.joinToString(",") {
"${ it.first } -> ${ it.second }"
}
}
})
}
Log.d(TAG, "getAppUpgradeInfo: -> records:" + records?.entries?.joinToString(",") { itx -> "key:${itx.key} -> value:[${itx.value.joinToString(",") { "${it.first},${it.second}" } }]"})
val versionCode = AppUtils.getAppVersionCode()

View File

@@ -166,6 +166,7 @@ class UpgradeManager : IDownloadListener {
}
} else {
val apk = File(localPath)
upgradeProvider?.recordInstallStart()
withContext(Dispatchers.Main) {
ApkInstaller.installApp(Utils.getApp(), apk) { code, reason ->
if (code != PackageInstaller.STATUS_SUCCESS) {