Treat deleted in-progress downloads as canceled.
Jeff Sharkey [Fri, 4 Oct 2013 23:41:10 +0000 (16:41 -0700)]
Otherwise the download thread would keep going!

Bug: 11081405
Change-Id: Ib8f1b624b29cabc782b8a0047d7b5db7e39a17de

src/com/android/providers/downloads/DownloadThread.java

index def4d7f..93f8d65 100644 (file)
@@ -519,7 +519,7 @@ public class DownloadThread implements Runnable {
                 throw new StopRequestException(
                         Downloads.Impl.STATUS_PAUSED_BY_APP, "download paused by owner");
             }
-            if (mInfo.mStatus == Downloads.Impl.STATUS_CANCELED) {
+            if (mInfo.mStatus == Downloads.Impl.STATUS_CANCELED || mInfo.mDeleted) {
                 throw new StopRequestException(Downloads.Impl.STATUS_CANCELED, "download canceled");
             }
         }