调整更新推送逻辑

This commit is contained in:
juntao
2020-08-26 19:52:38 +08:00
parent 97472b8259
commit 8fa3f3d832

View File

@ -235,12 +235,12 @@ public class UpdateManager {
loadingDialog.dismiss();
}
if (response != null) {
if (appEntity.isForce() || isUpdateFileDownloaded(response)) {
showUpdateDialog(response);
if (!appEntity.isForce()
&& !isUpdateFileDownloaded(response)
&& NetworkUtils.isWifiConnected(mContext)) {
createUpdate(response, true);
} else {
if (NetworkUtils.isWifiConnected(mContext)) {
createUpdate(response, true);
}
showUpdateDialog(response);
}
if (handler != null) {
Message message = new Message();
@ -414,7 +414,7 @@ public class UpdateManager {
}
downloadEntity.setPackageName(mContext.getPackageName());
DownloadManager.getInstance(mContext).cancel(downloadEntity.getUrl(), false, true);
DownloadManager.getInstance(mContext).cancel(downloadEntity.getUrl(), true, true);
DownloadManager.getInstance(mContext).pauseAll();
AppExecutor.getUiExecutor().executeWithDelay(() -> {