summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-08-03 23:10:46 (GMT)
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-08-03 23:10:46 (GMT)
commit70303529312bcd177096f52bcdb2613330e80dd2 (patch)
tree7eca46e6ec40f26fa6154f5c093f020282b20c39
parentc4d1aebba77c21955c3065764085f008d49b670f (diff)
parent454cf9bf59c12f370e2c7bd6cebec417fa0b7a9f (diff)
downloadandroid_packages_providers_DownloadProvider-70303529312bcd177096f52bcdb2613330e80dd2.zip
android_packages_providers_DownloadProvider-70303529312bcd177096f52bcdb2613330e80dd2.tar.gz
android_packages_providers_DownloadProvider-70303529312bcd177096f52bcdb2613330e80dd2.tar.bz2
Snap for 5778794 from 454cf9bf59c12f370e2c7bd6cebec417fa0b7a9f to qt-qpr1-release
Change-Id: I6a717ec2b7bad082350e9eeb07e042e9e48ce76f
-rw-r--r--src/com/android/providers/downloads/DownloadProvider.java5
-rw-r--r--tests/src/com/android/providers/downloads/AbstractDownloadProviderFunctionalTest.java6
2 files changed, 11 insertions, 0 deletions
diff --git a/src/com/android/providers/downloads/DownloadProvider.java b/src/com/android/providers/downloads/DownloadProvider.java
index 550c8fb..eb0313c 100644
--- a/src/com/android/providers/downloads/DownloadProvider.java
+++ b/src/com/android/providers/downloads/DownloadProvider.java
@@ -851,6 +851,8 @@ public final class DownloadProvider extends ContentProvider {
mediaStoreUri.toString());
filteredValues.put(COLUMN_MEDIA_SCANNED, MEDIA_SCANNED);
}
+ MediaStore.scanFile(getContext(),
+ new File(filteredValues.getAsString(Downloads.Impl._DATA)));
} finally {
restoreCallingIdentity(token);
}
@@ -1551,6 +1553,9 @@ public final class DownloadProvider extends ContentProvider {
qb.update(db, updateValues, Downloads.Impl._ID + "=?",
new String[] { Long.toString(info.mId) });
}
+ if (Downloads.Impl.isStatusSuccess(info.mStatus)) {
+ MediaStore.scanFile(getContext(), new File(info.mFileName));
+ }
}
if (updateSchedule) {
Helpers.scheduleJob(context, info);
diff --git a/tests/src/com/android/providers/downloads/AbstractDownloadProviderFunctionalTest.java b/tests/src/com/android/providers/downloads/AbstractDownloadProviderFunctionalTest.java
index 38bf4d6..6acdfed 100644
--- a/tests/src/com/android/providers/downloads/AbstractDownloadProviderFunctionalTest.java
+++ b/tests/src/com/android/providers/downloads/AbstractDownloadProviderFunctionalTest.java
@@ -33,6 +33,7 @@ import android.database.DatabaseUtils;
import android.database.MatrixCursor;
import android.net.Uri;
import android.os.Binder;
+import android.os.Bundle;
import android.os.IBinder;
import android.provider.Downloads;
import android.provider.MediaStore;
@@ -123,6 +124,11 @@ public abstract class AbstractDownloadProviderFunctionalTest extends
}
@Override
+ public Bundle call(String method, String request, Bundle args) {
+ return new Bundle();
+ }
+
+ @Override
public IBinder getIContentProviderBinder() {
return new Binder();
}