summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2014-12-04 15:38:04 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-12-04 15:38:04 +0000
commit9200927da3277128cfb517d54cea8be52d6ae602 (patch)
treef469db2235396dd9e6fc34dea3191bf5bd1da1b9
parent1646ab9f8650d341af3e976a1afead8b79365bdc (diff)
parent07ac056d22b7281b38bb323283f046e720e4a15b (diff)
downloadandroid_packages_providers_MediaProvider-9200927da3277128cfb517d54cea8be52d6ae602.tar.gz
android_packages_providers_MediaProvider-9200927da3277128cfb517d54cea8be52d6ae602.tar.bz2
android_packages_providers_MediaProvider-9200927da3277128cfb517d54cea8be52d6ae602.zip
Merge "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 4e67ed8d..da6eeb65 100755
--- a/src/com/android/providers/media/MediaProvider.java
+++ b/src/com/android/providers/media/MediaProvider.java
@@ -2858,7 +2858,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;
@@ -2870,7 +2874,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.