From 3a4a3e7cd5a379e7e757177826ba935f000eb455 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Fri, 24 Jun 2016 18:13:22 -0600 Subject: Make scanning decisions based on latest data. When deciding to kick off a media scan of a newly-downloaded file, use the latest values from InfoDelta, instead of stale values from the last database read, which may lead us to skip the scan. Bug: 29234780 Change-Id: I7ffbcdd1edb9965999b7f5f100f57a9c2933f3a5 --- src/com/android/providers/downloads/DownloadInfo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/com/android/providers/downloads/DownloadInfo.java') diff --git a/src/com/android/providers/downloads/DownloadInfo.java b/src/com/android/providers/downloads/DownloadInfo.java index 00a2dd78..c571de4d 100644 --- a/src/com/android/providers/downloads/DownloadInfo.java +++ b/src/com/android/providers/downloads/DownloadInfo.java @@ -448,12 +448,12 @@ public class DownloadInfo { /** * Returns whether a file should be scanned */ - public boolean shouldScanFile() { + public boolean shouldScanFile(int status) { return (mMediaScanned == 0) && (mDestination == Downloads.Impl.DESTINATION_EXTERNAL || mDestination == Downloads.Impl.DESTINATION_FILE_URI || mDestination == Downloads.Impl.DESTINATION_NON_DOWNLOADMANAGER_DOWNLOAD) - && Downloads.Impl.isStatusSuccess(mStatus); + && Downloads.Impl.isStatusSuccess(status); } /** -- cgit v1.2.3