summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--media/java/android/media/MediaScanner.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/media/java/android/media/MediaScanner.java b/media/java/android/media/MediaScanner.java
index c6c1ccb..6f8b809 100644
--- a/media/java/android/media/MediaScanner.java
+++ b/media/java/android/media/MediaScanner.java
@@ -523,6 +523,13 @@ public class MediaScanner
try {
FileEntry entry = beginFile(path, mimeType, lastModified,
fileSize, isDirectory, noMedia);
+
+ // if this file was just inserted via mtp, set the rowid to zero
+ // (even though it already exists in the database), to trigger
+ // the correct code path for updating its entry
+ if (mMtpObjectHandle != 0) {
+ entry.mRowId = 0;
+ }
// rescan for metadata if file was modified since last scan
if (entry != null && (entry.mLastModifiedChanged || scanAlways)) {
if (noMedia) {