[2.15.0] 优化obu升级
This commit is contained in:
@@ -99,6 +99,7 @@ class UpgradeManager : IDownload {
|
||||
}
|
||||
|
||||
override fun onFinished(downloadUrl: String?, threadBean: ThreadBean?, localPath: String) {
|
||||
Log.d(TAG, "onFinished downloadUrl = $downloadUrl")
|
||||
if (downloadUrl == null) {
|
||||
return
|
||||
}
|
||||
@@ -244,14 +245,20 @@ class UpgradeManager : IDownload {
|
||||
}
|
||||
override fun onProgress(url: String?, length: Int) {
|
||||
// CallerLogger.d("$M_DEVA$TAG", "updateUpgradeProgress onPause ----> length = $length")
|
||||
if (length in 1..99) {
|
||||
updateStatusBarDownloadView(true, "download", length)
|
||||
val type = types[url]
|
||||
if (type == APK || type == PATCH) {
|
||||
if (length in 1..99) {
|
||||
updateStatusBarDownloadView(true, "download", length)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFinished(url: String?, localPath: String) {
|
||||
UiThreadHandler.postDelayed({
|
||||
updateStatusBarDownloadView(false, "download", 100)
|
||||
val type = types[url]
|
||||
if (type == APK || type == PATCH) {
|
||||
updateStatusBarDownloadView(false, "download", 100)
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
@@ -271,7 +278,6 @@ class UpgradeManager : IDownload {
|
||||
//下载完成,解压文件
|
||||
try {
|
||||
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}", " onFinished localPath = $localPath")
|
||||
Log.d("liyz", " onFinished localPath = $localPath")
|
||||
val dest = File(localPath)
|
||||
val files = ZipUtils.unzipFile(localPath, Config.downLoadUnzipObuPath)
|
||||
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}", " onFinished file = ${Config.downLoadObuPath + dest.name} -----files = $files ")
|
||||
@@ -295,32 +301,4 @@ class UpgradeManager : IDownload {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* obu升级包下载监听
|
||||
*/
|
||||
// fun updateObuUpgradeStatus(context: Context) {
|
||||
// CallerDevaToolsUpgradeListenerManager.addListener(
|
||||
// TAG,
|
||||
// object : IMogoDevaToolsUpgradeListener {
|
||||
// override fun onStart(url: String?) {
|
||||
// CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}", "----updateObuUpgradeStatus onStart ")
|
||||
// }
|
||||
// override fun onPause(url: String?) {
|
||||
// CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}", "----updateObuUpgradeStatus onPause ")
|
||||
// }
|
||||
// override fun onProgress(url: String?, length: Int) {
|
||||
// }
|
||||
//
|
||||
// override fun onFinished(url: String?, localPath: String) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// override fun onError(url: String?, errorMsg: String?) {
|
||||
// CallerLogger.e("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}", "----updateObuUpgradeStatus errorMsg = $errorMsg ")
|
||||
// //下载失败,删除文件夹
|
||||
// CallerObuApiManager.deleteObuFile()
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
}
|
||||
@@ -152,7 +152,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
//OBU连接状态
|
||||
private var obuConnectStatus: Boolean = false
|
||||
private var mObuInfoStr: String = ""
|
||||
|
||||
//渠道包标签
|
||||
private var onlineSelected: Boolean = true
|
||||
@@ -1688,8 +1687,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
} else {
|
||||
tbIsDemoMode?.text = "开启美化模式"
|
||||
}
|
||||
//obu信息,排查obu相关问题使用
|
||||
tvObuInfoContent.text = mObuInfoStr
|
||||
|
||||
obuConnectStatusTv.text = Html.fromHtml(
|
||||
"OBU连接状态:${
|
||||
@@ -2106,7 +2103,10 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
override fun onGetObuInfo(obuInfoStr: String?) {
|
||||
obuInfoStr?.let {
|
||||
mObuInfoStr = it
|
||||
//obu信息,排查obu相关问题使用
|
||||
UiThreadHandler.post {
|
||||
tvObuInfoContent.text = it
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -157,6 +157,7 @@ public class DownloadService implements InitThread.InitCallBack, DownloadCallBac
|
||||
public void threadDownLoadFinished(String url, ThreadBean threadBean, String localPath) {
|
||||
IDownload iDownload = callBacks.get(url);
|
||||
Log.d(DOWN_LOAD_TAG, "下载完成 -----> iDownload = " + iDownload);
|
||||
Log.d("UpgradeManager", "-------threadDownLoadFinished localPath = " + localPath + "---iDownload = " + iDownload);
|
||||
if (iDownload != null) {
|
||||
iDownload.onFinished(url, threadBean, localPath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user