diff options
Diffstat (limited to 'src/com/cyanogenmod/eleven/provider/MusicDB.java')
-rw-r--r-- | src/com/cyanogenmod/eleven/provider/MusicDB.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/cyanogenmod/eleven/provider/MusicDB.java b/src/com/cyanogenmod/eleven/provider/MusicDB.java index 1b7d3cb..8090626 100644 --- a/src/com/cyanogenmod/eleven/provider/MusicDB.java +++ b/src/com/cyanogenmod/eleven/provider/MusicDB.java @@ -28,12 +28,13 @@ public class MusicDB extends SQLiteOpenHelper { * v2 Oct 7 2014 Added a new class MusicPlaybackState - need to bump version so the new * tables are created, but need to remove all drops from other classes to * 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 */ /* Version constant to increment when the database should be rebuilt */ - private static final int VERSION = 2; + private static final int VERSION = 3; /* Name of database file */ public static final String DATABASENAME = "musicdb.db"; @@ -42,7 +43,6 @@ public class MusicDB extends SQLiteOpenHelper { private final Context mContext; - /** * @param context The {@link android.content.Context} to use * @return A new instance of this class. @@ -62,30 +62,36 @@ public class MusicDB extends SQLiteOpenHelper { @Override public void onCreate(SQLiteDatabase db) { + PropertiesStore.getInstance(mContext).onCreate(db); PlaylistArtworkStore.getInstance(mContext).onCreate(db); RecentStore.getInstance(mContext).onCreate(db); SongPlayCount.getInstance(mContext).onCreate(db); SearchHistory.getInstance(mContext).onCreate(db); MusicPlaybackState.getInstance(mContext).onCreate(db); + LocalizedStore.getInstance(mContext).onCreate(db); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { + PropertiesStore.getInstance(mContext).onUpgrade(db, oldVersion, newVersion); PlaylistArtworkStore.getInstance(mContext).onUpgrade(db, oldVersion, newVersion); RecentStore.getInstance(mContext).onUpgrade(db, oldVersion, newVersion); SongPlayCount.getInstance(mContext).onUpgrade(db, oldVersion, newVersion); SearchHistory.getInstance(mContext).onUpgrade(db, oldVersion, newVersion); MusicPlaybackState.getInstance(mContext).onUpgrade(db, oldVersion, newVersion); + LocalizedStore.getInstance(mContext).onUpgrade(db, oldVersion, newVersion); } @Override public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) { Log.w(MusicDB.class.getSimpleName(), "Downgrading from: " + oldVersion + " to " + newVersion + ". Dropping tables"); + PropertiesStore.getInstance(mContext).onDowngrade(db, oldVersion, newVersion); PlaylistArtworkStore.getInstance(mContext).onDowngrade(db, oldVersion, newVersion); RecentStore.getInstance(mContext).onDowngrade(db, oldVersion, newVersion); SongPlayCount.getInstance(mContext).onDowngrade(db, oldVersion, newVersion); SearchHistory.getInstance(mContext).onDowngrade(db, oldVersion, newVersion); MusicPlaybackState.getInstance(mContext).onDowngrade(db, oldVersion, newVersion); + LocalizedStore.getInstance(mContext).onDowngrade(db, oldVersion, newVersion); } } |