summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorClark Scheff <clark@cyngn.com>2014-05-05 16:07:37 -0700
committerd34d <clark@cyngn.com>2014-05-10 11:27:12 -0700
commitbd04dff20feba012f8e98bea07adf5c02102efcb (patch)
tree0ea9a4c8a6078691990022c00686e69f70ae6f41 /src
parentd0f415ae26b2e35508adacc920c8ea4ae809ccce (diff)
downloadandroid_packages_providers_ThemesProvider-bd04dff20feba012f8e98bea07adf5c02102efcb.zip
android_packages_providers_ThemesProvider-bd04dff20feba012f8e98bea07adf5c02102efcb.tar.gz
android_packages_providers_ThemesProvider-bd04dff20feba012f8e98bea07adf5c02102efcb.tar.bz2
Include alarms in mixnmatch.
Change-Id: I11a63b665550fc7f8f89df837ab0fc8ebcd2c8d3
Diffstat (limited to 'src')
-rw-r--r--src/org/cyanogenmod/themes/provider/ThemesOpenHelper.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/org/cyanogenmod/themes/provider/ThemesOpenHelper.java b/src/org/cyanogenmod/themes/provider/ThemesOpenHelper.java
index 092536d..915f465 100644
--- a/src/org/cyanogenmod/themes/provider/ThemesOpenHelper.java
+++ b/src/org/cyanogenmod/themes/provider/ThemesOpenHelper.java
@@ -20,6 +20,7 @@ import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
+import android.provider.ThemesContract;
import android.provider.ThemesContract.ThemesColumns;
import android.provider.ThemesContract.MixnMatchColumns;
import android.util.Log;
@@ -27,7 +28,7 @@ import android.util.Log;
public class ThemesOpenHelper extends SQLiteOpenHelper {
private static final String TAG = ThemesOpenHelper.class.getName();
- private static final int DATABASE_VERSION = 2;
+ private static final int DATABASE_VERSION = 3;
private static final String DATABASE_NAME = "themes.db";
private static final String DEFAULT_PKG_NAME = "default";
@@ -52,6 +53,10 @@ public class ThemesOpenHelper extends SQLiteOpenHelper {
upgradeToVersion2(db);
oldVersion = 2;
}
+ if (oldVersion == 2) {
+ upgradeToVersion3(db);
+ oldVersion = 3;
+ }
if (oldVersion != DATABASE_VERSION) {
Log.e(TAG, "Recreating db because unknown database version: " + oldVersion);
dropTables(db);
@@ -72,6 +77,14 @@ public class ThemesOpenHelper extends SQLiteOpenHelper {
db.execSQL(addStyleColumn);
}
+ private void upgradeToVersion3(SQLiteDatabase db) {
+ // Add default value to mixnmatch for KEY_ALARM
+ ContentValues values = new ContentValues();
+ values.put(MixnMatchColumns.COL_KEY, ThemesContract.MixnMatchColumns.KEY_ALARM);
+ values.put(MixnMatchColumns.COL_VALUE, DEFAULT_PKG_NAME);
+ db.insert(MixnMatchTable.TABLE_NAME, null, values);
+ }
+
private void dropTables(SQLiteDatabase db) {
db.execSQL("DROP TABLE IF EXISTS " + ThemesTable.TABLE_NAME);
db.execSQL("DROP TABLE IF EXISTS " + MixnMatchTable.TABLE_NAME);