尝试处理游戏搜索页和下载管理页的ANR问题
This commit is contained in:
@ -689,11 +689,13 @@ public class DownloadManager implements DownloadStatusListener {
|
||||
public void cancel(String url, boolean isDeleteFile, boolean automatic) {
|
||||
DownloadEntity entry = mDownloadDao.get(url);
|
||||
if (entry != null) {
|
||||
if (isDeleteFile) {
|
||||
FileUtils.deleteFile(entry.getPath());
|
||||
}
|
||||
mDownloadDao.delete(url);
|
||||
Utils.log(DownloadManager.class.getSimpleName(), "cancel==>record were deleted!");
|
||||
AppExecutor.getIoExecutor().execute(() -> {
|
||||
if (isDeleteFile) {
|
||||
FileUtils.deleteFile(entry.getPath());
|
||||
}
|
||||
mDownloadDao.delete(url);
|
||||
Utils.log(DownloadManager.class.getSimpleName(), "cancel==>record were deleted!");
|
||||
});
|
||||
}
|
||||
if (entry != null) {
|
||||
if (automatic) {
|
||||
|
||||
Reference in New Issue
Block a user