修复更新进度跳跃问题
This commit is contained in:
@ -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("立即安装");
|
||||
|
||||
Reference in New Issue
Block a user