Skip scanning a file which will be deleted.
Jeff Sharkey [Fri, 5 Oct 2012 22:09:00 +0000 (15:09 -0700)]
When deleting a download, don't bother scanning it, since we'll just
delete it moments later.  This was already racy since it didn't even
wait for the scan to complete.

Bug: 7256243
Change-Id: I8c3b96823d94bc1688ef336cb45746ccd35fc760

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

index 7030dea..8380830 100644 (file)
@@ -479,9 +479,6 @@ public class DownloadService extends Service {
      */
     private void deleteDownloadLocked(long id) {
         DownloadInfo info = mDownloads.get(id);
-        if (info.shouldScanFile()) {
-            scanFile(info, false, false);
-        }
         if (info.mStatus == Downloads.Impl.STATUS_RUNNING) {
             info.mStatus = Downloads.Impl.STATUS_CANCELED;
         }