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);
|
||||
final Cursor c = downloadManagerWrapper.query(q);
|
||||
if (c != null) {
|
||||
if (c.moveToFirst()) {
|
||||
while (c.moveToNext()) {
|
||||
for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) {
|
||||
final long downloadId = c
|
||||
.getLong(c.getColumnIndex(DownloadManager.COLUMN_ID));
|
||||
downloadManagerWrapper.remove(downloadId);
|
||||
Log.i(TAG, "Removed the download with Id: " + downloadId);
|
||||
}
|
||||
}
|
||||
c.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Reference in New Issue