OSDN Git Service

Eleven: Fix LocalizedSongSort - Missed Collate keyword
authorlinus_lee <llee@cyngn.com>
Tue, 6 Jan 2015 23:20:28 +0000 (15:20 -0800)
committerlinus_lee <llee@cyngn.com>
Wed, 7 Jan 2015 21:37:06 +0000 (13:37 -0800)
Change-Id: Ief86b3fea672bcc498a4560fab40486657cc2751

src/com/cyanogenmod/eleven/provider/LocalizedStore.java
src/com/cyanogenmod/eleven/provider/MusicDB.java

index 43367e6..d3a33d1 100644 (file)
@@ -110,7 +110,7 @@ public class LocalizedStore {
                     SongSortColumns.ID + " INTEGER PRIMARY KEY," +
                     SongSortColumns.ARTIST_ID + " INTEGER NOT NULL," +
                     SongSortColumns.ALBUM_ID + " INTEGER NOT NULL," +
-                    SongSortColumns.NAME + " TEXT," +
+                    SongSortColumns.NAME + " TEXT COLLATE LOCALIZED," +
                     SongSortColumns.NAME_LABEL + " TEXT," +
                     SongSortColumns.NAME_BUCKET + " INTEGER);",
 
@@ -137,8 +137,11 @@ public class LocalizedStore {
     }
 
     public void onUpgrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) {
-        // this table was created in version 3 so call the onCreate method if we hit that scenario
-        if (oldVersion < 3 && newVersion >= 3) {
+        // this table was created in version 3 so call the onCreate method if oldVersion <= 2
+        // in version 4 we need to recreate the SongSortcolumns table so drop the table and call
+        // onCreate if oldVersion <= 3
+        if (oldVersion <= 3) {
+            db.execSQL("DROP TABLE IF EXISTS " + SongSortColumns.TABLE_NAME);
             onCreate(db);
         }
     }
index 8090626..84c64a0 100644 (file)
@@ -30,11 +30,12 @@ public class MusicDB extends SQLiteOpenHelper {
      *                  maintain data
      * v3 Dec 4 2014    Add Sorting tables similar to Contacts to enable other languages like
      *                  Chinese to properly sort as they would expect
+     * v4 Jan 6 2015    Missed Collate keyword on the LocalizedSongSortTable
      */
 
 
     /* Version constant to increment when the database should be rebuilt */
-    private static final int VERSION = 3;
+    private static final int VERSION = 4;
 
     /* Name of database file */
     public static final String DATABASENAME = "musicdb.db";