Fix default ring/alarm/notification insertion

Before directly inserting an item that is the default ringtone, alarm or
notification, flush the MediaInserter, since a parent of the inserted item
might not have been flushed yet.

b/7650557

Change-Id: Icdd25bd9cac8b43a75e63318b936246562744c59
This commit is contained in:
Marco Nelissen
2012-12-03 15:11:15 -08:00
parent d5dcb6d4e9
commit 4ecfce6f6f

View File

@@ -958,6 +958,7 @@ public class MediaScanner
// If the rowId of the inserted file is needed, it gets inserted immediately,
// bypassing the bulk inserter.
if (inserter == null || needToSetSettings) {
inserter.flushAll();
result = mMediaProvider.insert(tableUri, values);
} else if (entry.mFormat == MtpConstants.FORMAT_ASSOCIATION) {
inserter.insertwithPriority(tableUri, values);