尝试缓存下载队列状态,避免下载按钮直接访问数据库

This commit is contained in:
juntao
2021-09-29 17:44:40 +08:00
parent 047c45db9a
commit ad6114a44b
5 changed files with 20 additions and 9 deletions

View File

@ -105,7 +105,7 @@ public class GameUtils {
}
}
downloadEntity = DownloadManager.getInstance(context).getDownloadEntityByUrl(apkEntity.getUrl());
downloadEntity = DownloadManager.getInstance(context).getDownloadEntitySnapshotByUrl(apkEntity.getUrl());
if (downloadEntity != null) {
if (downloadEntity.getStatus().equals(DownloadStatus.done)) {
doneCount++;
@ -191,7 +191,7 @@ public class GameUtils {
}
}
downloadEntity = DownloadManager.getInstance(context).getDownloadEntityByUrl(apkEntity.getUrl());
downloadEntity = DownloadManager.getInstance(context).getDownloadEntitySnapshotByUrl(apkEntity.getUrl());
if (downloadEntity != null) {
if (downloadEntity.getStatus().equals(DownloadStatus.done)) {
doneCount++;