summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2014-12-04 20:44:08 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-12-04 20:44:08 +0000
commita79f009cee8489fb52920ce243122b2483c0828d (patch)
tree4f3e4e237d1e36a5804d427d4cc17aa12f3ee04d
parentff6b872bb5d80afd0d615aa49cb959760fb0d5a8 (diff)
parent91a80e32495a825afc3bb13428d3154bf394d747 (diff)
downloadandroid_packages_providers_MediaProvider-a79f009cee8489fb52920ce243122b2483c0828d.tar.gz
android_packages_providers_MediaProvider-a79f009cee8489fb52920ce243122b2483c0828d.tar.bz2
android_packages_providers_MediaProvider-a79f009cee8489fb52920ce243122b2483c0828d.zip
am 91a80e32: am 9200927d: Merge "MediaProvider: When insert files to "internal.db", Don\'t notify MTP."
* commit '91a80e32495a825afc3bb13428d3154bf394d747': MediaProvider: When insert files to "internal.db", Don't notify MTP.
-rwxr-xr-xsrc/com/android/providers/media/MediaProvider.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/android/providers/media/MediaProvider.java b/src/com/android/providers/media/MediaProvider.java
index ee4aad3e..6044d996 100755
--- a/src/com/android/providers/media/MediaProvider.java
+++ b/src/com/android/providers/media/MediaProvider.java
@@ -2877,7 +2877,11 @@ public class MediaProvider extends ContentProvider {
}
// Notify MTP (outside of successful transaction)
- notifyMtp(notifyRowIds);
+ if (uri != null) {
+ if (uri.toString().startsWith("content://media/external/")) {
+ notifyMtp(notifyRowIds);
+ }
+ }
getContext().getContentResolver().notifyChange(uri, null);
return numInserted;
@@ -2889,7 +2893,11 @@ public class MediaProvider extends ContentProvider {
ArrayList<Long> notifyRowIds = new ArrayList<Long>();
Uri newUri = insertInternal(uri, match, initialValues, notifyRowIds);
- notifyMtp(notifyRowIds);
+ if (uri != null) {
+ if (uri.toString().startsWith("content://media/external/")) {
+ notifyMtp(notifyRowIds);
+ }
+ }
// do not signal notification for MTP objects.
// we will signal instead after file transfer is successful.