修复更新进度跳跃问题

This commit is contained in:
juntao
2020-08-27 16:32:29 +08:00
parent 58f230038c
commit c41e996add

View File

@ -335,6 +335,10 @@ public class UpdateManager {
PackageInstaller.install(mContext, path);
} else {
MtaHelper.onEvent("软件更新", "下载开始");
if (isUpdateFileDownloaded(md5)) {
deleteDownloadedFile(md5);
}
showDownloadDialog(md5);
}
});
@ -437,6 +441,12 @@ public class UpdateManager {
return file.exists() && file.length() == SPUtils.getLong(Constants.LAST_GHZS_UPDATE_FILE_SIZE, 0);
}
private void deleteDownloadedFile(String md5) {
String path = FileUtils.getDownloadPath(mContext, "光环助手V" + appEntity.getVersion() + "_" + md5 + ".apk");
File file = new File(path);
file.delete();
}
private void updateUpdateDialogView(boolean isUpdateDownloaded) {
if (isUpdateDownloaded) {
confirmTextView.setText("立即安装");