summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2010-04-20 11:42:02 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-04-20 11:42:02 -0700
commit03e4b571ea4b92da67b0e88e4f342410524df8bd (patch)
tree8042447edd2270a57d6cb76e58eec358e23a7841 /media
parent7dc9bcea533f396bcd3b96cb028893f50e728fe0 (diff)
parentfe13eebee964cd9e91270403e3910c08d898ad31 (diff)
downloadframeworks_base-03e4b571ea4b92da67b0e88e4f342410524df8bd.zip
frameworks_base-03e4b571ea4b92da67b0e88e4f342410524df8bd.tar.gz
frameworks_base-03e4b571ea4b92da67b0e88e4f342410524df8bd.tar.bz2
am fe13eebe: am 9d14e3ea: am 9b8b417c: Merge "When updating existing entries in the media database, don\'t update the is_music, is_ringtone, etc columns. This ensures that custom ringtones will still be shown in the ringtone picker after a rescan. Bug 2594125 Change-I
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/MediaScanner.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/media/java/android/media/MediaScanner.java b/media/java/android/media/MediaScanner.java
index f845fec..e80ece6 100644
--- a/media/java/android/media/MediaScanner.java
+++ b/media/java/android/media/MediaScanner.java
@@ -714,7 +714,12 @@ public class MediaScanner
}
}
}
- if (isAudio) {
+ long rowId = entry.mRowId;
+ if (isAudio && rowId == 0) {
+ // Only set these for new entries. For existing entries, they
+ // may have been modified later, and we want to keep the current
+ // values so that custom ringtones still show up in the ringtone
+ // picker.
values.put(Audio.Media.IS_RINGTONE, ringtones);
values.put(Audio.Media.IS_NOTIFICATION, notifications);
values.put(Audio.Media.IS_ALARM, alarms);
@@ -764,7 +769,6 @@ public class MediaScanner
}
Uri result = null;
- long rowId = entry.mRowId;
if (rowId == 0) {
// new file, insert it
result = mMediaProvider.insert(tableUri, values);