Fix the previous downloads logic to not missing any downloads.
Bug: 21797386 Change-Id: Ic09698b28e31b4f16831898d7cb08853f4e5df4amain
parent
73aaf68337
commit
bf7c0106b0
|
@ -122,14 +122,12 @@ public final class SystemBroadcastReceiver extends BroadcastReceiver {
|
||||||
| DownloadManager.STATUS_RUNNING);
|
| DownloadManager.STATUS_RUNNING);
|
||||||
final Cursor c = downloadManagerWrapper.query(q);
|
final Cursor c = downloadManagerWrapper.query(q);
|
||||||
if (c != null) {
|
if (c != null) {
|
||||||
if (c.moveToFirst()) {
|
for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) {
|
||||||
while (c.moveToNext()) {
|
|
||||||
final long downloadId = c
|
final long downloadId = c
|
||||||
.getLong(c.getColumnIndex(DownloadManager.COLUMN_ID));
|
.getLong(c.getColumnIndex(DownloadManager.COLUMN_ID));
|
||||||
downloadManagerWrapper.remove(downloadId);
|
downloadManagerWrapper.remove(downloadId);
|
||||||
Log.i(TAG, "Removed the download with Id: " + downloadId);
|
Log.i(TAG, "Removed the download with Id: " + downloadId);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
c.close();
|
c.close();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Reference in New Issue