diff options
author | Sudheer Shanka <sudheersai@google.com> | 2019-01-29 14:53:58 -0800 |
---|---|---|
committer | Sudheer Shanka <sudheersai@google.com> | 2019-01-29 18:00:31 -0800 |
commit | 5bf5cedcfbe27ae6febbc3871fdcc97494d3cfe6 (patch) | |
tree | 385f5fd9f96cb9af870d1d5aa15bfa2759f72226 /src/com/android/providers/downloads/DownloadThread.java | |
parent | 985aeeba373be100a3ca57cc6b1a9a58dca8b3d9 (diff) | |
download | android_packages_providers_DownloadProvider-5bf5cedcfbe27ae6febbc3871fdcc97494d3cfe6.tar.gz android_packages_providers_DownloadProvider-5bf5cedcfbe27ae6febbc3871fdcc97494d3cfe6.tar.bz2 android_packages_providers_DownloadProvider-5bf5cedcfbe27ae6febbc3871fdcc97494d3cfe6.zip |
Don't ignore COLUMN_MEDIA_SCANNED values from caller.
Right now, DownloadProvider only uses the COLUMN_MEDIA_SCANNED
value if it is coming from addCompletedDownload and for the rest
of the requests, it ignores the incoming COLUMN_MEDIA_SCANNED value
and always invokes mediascanner. This is not what the documentation
says. For e.g., if the caller uses DownloadManager.setDestinationUri()
API, then unless otherwise specified, the download doesn't need to be
mediascanned.
Also, since we are inserting user visible downloads to MediaProvider,
use that info to populate the COLUMN_MEDIAPROVIDER_URI column as well
and update DownloadProvider to not invoke MediaScanner.
Bug: 123440050
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: Ia667319a811d502d42a0602581bdc34ed46d88f7
Diffstat (limited to 'src/com/android/providers/downloads/DownloadThread.java')
-rw-r--r-- | src/com/android/providers/downloads/DownloadThread.java | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/com/android/providers/downloads/DownloadThread.java b/src/com/android/providers/downloads/DownloadThread.java index 54cc1a5d..bc7997f6 100644 --- a/src/com/android/providers/downloads/DownloadThread.java +++ b/src/com/android/providers/downloads/DownloadThread.java @@ -388,12 +388,7 @@ public class DownloadThread extends Thread { } boolean needsReschedule = false; - if (Downloads.Impl.isStatusCompleted(mInfoDelta.mStatus)) { - if (mInfo.shouldScanFile(mInfoDelta.mStatus)) { - DownloadScanner.requestScanBlocking(mContext, mInfo.mId, mInfoDelta.mFileName, - mInfoDelta.mMimeType); - } - } else if (mInfoDelta.mStatus == STATUS_WAITING_TO_RETRY + if (mInfoDelta.mStatus == STATUS_WAITING_TO_RETRY || mInfoDelta.mStatus == STATUS_WAITING_FOR_NETWORK || mInfoDelta.mStatus == STATUS_QUEUED_FOR_WIFI) { needsReschedule = true; |