From f96f51e8d7386341ca209c795cc6621ab0608d45 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Fri, 14 Oct 2016 15:31:37 -0600 Subject: Only send DOWNLOAD_COMPLETE broadcast once. Apps might end up confused if we tell them a download was completed multiple times, so only send the broadcast exactly once when we transition it into a "completed" state, either during an update() or a delete() operation. Test: verified single broadcast with test app Bug: 31619480 Change-Id: I0b9139ea0e37f6d212b84314048692cd0c4f9cdf --- src/com/android/providers/downloads/DownloadThread.java | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/com/android/providers/downloads/DownloadThread.java') diff --git a/src/com/android/providers/downloads/DownloadThread.java b/src/com/android/providers/downloads/DownloadThread.java index 33436f57..c6b4c71a 100644 --- a/src/com/android/providers/downloads/DownloadThread.java +++ b/src/com/android/providers/downloads/DownloadThread.java @@ -382,11 +382,6 @@ public class DownloadThread extends Thread { } if (Downloads.Impl.isStatusCompleted(mInfoDelta.mStatus)) { - // If download was canceled, we already sent requested intent when - // deleted in the provider - if (mInfoDelta.mStatus != STATUS_CANCELED) { - mInfo.sendIntentIfRequested(); - } if (mInfo.shouldScanFile(mInfoDelta.mStatus)) { DownloadScanner.requestScanBlocking(mContext, mInfo.mId, mInfoDelta.mFileName, mInfoDelta.mMimeType); -- cgit v1.2.3