Commit 407c6ddc authored by Mike Lockwood's avatar Mike Lockwood
Browse files

Reset album and artist tables due to change in how collation keys are calculated.

Bug: 18118488
Change-Id: If1d12def4598be9cbf86b8550061f4d075be9717
parent e11db3f7
......@@ -2,7 +2,7 @@
package="com.android.providers.media"
android:sharedUserId="android.media"
android:sharedUserLabel="@string/uid_label"
android:versionCode="700">
android:versionCode="800">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
......
......@@ -1858,6 +1858,16 @@ public class MediaProvider extends ContentProvider {
+ " AND datetaken<date_modified*5;");
}
if (fromVersion < 800) {
// Delete albums and artists, then clear the modification time on songs, which
// will cause the media scanner to rescan everything, rebuilding the artist and
// album tables along the way, while preserving playlists.
// We need this rescan because ICU also changed, and now generates different
// collation keys
db.execSQL("DELETE from albums");
db.execSQL("DELETE from artists");
db.execSQL("UPDATE files SET date_modified=0;");
}
sanityCheck(db, fromVersion);
long elapsedSeconds = (SystemClock.currentTimeMicro() - startTime) / 1000000;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment