diff options
author | Marco Nelissen <marcone@google.com> | 2010-04-20 09:46:00 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2010-04-20 09:47:31 -0700 |
commit | c066557378c2305625a7bad3d25f084ad647ef27 (patch) | |
tree | cb8333509ee9bda7436093f1b50a432647b7a876 /media | |
parent | 758dd527f64f1e827adfe09f0141ab213733ca22 (diff) | |
download | frameworks_base-c066557378c2305625a7bad3d25f084ad647ef27.zip frameworks_base-c066557378c2305625a7bad3d25f084ad647ef27.tar.gz frameworks_base-c066557378c2305625a7bad3d25f084ad647ef27.tar.bz2 |
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-Id: I56761240d6f6e699514169d80a445317ba0de9e2
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/MediaScanner.java | 8 |
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); |