feat: 使用独立的数据库来存已安装的畅玩游戏
This commit is contained in:
@ -88,12 +88,7 @@ public class DownloadManager implements DownloadStatusListener {
|
||||
private final ArrayMap<String, DownloadStatus> statusMap;
|
||||
private final ArrayMap<String, DownloadEntity> downloadingMap;
|
||||
|
||||
// 下载任务列表快照,非完全实时状态,只保证数量和基础状态,不保证下载进度和速度匹配
|
||||
// TODO 使用 mDownloadSnapshotList 来服务 getDownloadEntityByUrl
|
||||
// private final List<DownloadEntity> mDownloadSnapshotList;
|
||||
|
||||
private ArrayList<DownloadEntity> mInvisiblePendingTaskList; // 用户不可见的 pending 任务
|
||||
|
||||
private final DownloadDao mDownloadDao;
|
||||
private final DownloadedGameIdAndPackageNameDao mDownloadedGameIdAndPackageNameDao;
|
||||
|
||||
@ -607,18 +602,6 @@ public class DownloadManager implements DownloadStatusListener {
|
||||
return mDownloadDao.getSnapshotByPackageName(packageName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 url 获取下载任务快照 (仅保证下载状态一致)
|
||||
*
|
||||
* @param gameId 游戏名 (若使用场景里有多包名,请使用 url 获取下载任务)
|
||||
* @return null 表示下载列表中不存在该任务,否则返回下载任务
|
||||
*/
|
||||
@Nullable
|
||||
public DownloadEntity getDownloadEntitySnapshotByGameId(String gameId) {
|
||||
if (TextUtils.isEmpty(gameId)) return null;
|
||||
return mDownloadDao.getSnapshotByGameId(gameId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据包名获取某一个下载任务 (涉及数据库查询,请优先在子线程调用)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user