summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authord34d <clark@cyngn.com>2015-05-20 21:30:21 (GMT)
committerd34d <clark@cyngn.com>2015-11-20 03:22:50 (GMT)
commit70ef064857296615e5ab777d91523e53e2581d3c (patch)
treefc040f330ecf43893090237136dcee481d81ed02 /src
parente17a588dfbfed60d2e0a7584c9253bafc6c13d57 (diff)
downloadandroid_packages_providers_ThemesProvider-70ef064857296615e5ab777d91523e53e2581d3c.zip
android_packages_providers_ThemesProvider-70ef064857296615e5ab777d91523e53e2581d3c.tar.gz
android_packages_providers_ThemesProvider-70ef064857296615e5ab777d91523e53e2581d3c.tar.bz2
Live lock screen support [2/2]
Change-Id: I63079611828cb82d732afec872e37038d1fe509c
Diffstat (limited to 'src')
-rw-r--r--src/org/cyanogenmod/themes/provider/ThemePackageHelper.java2
-rw-r--r--src/org/cyanogenmod/themes/provider/ThemesOpenHelper.java22
2 files changed, 23 insertions, 1 deletions
diff --git a/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java b/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java
index 83e8e19..fe30c7c 100644
--- a/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java
+++ b/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java
@@ -68,6 +68,8 @@ public class ThemePackageHelper {
"overlays/com.android.systemui");
sComponentToFolderName.put(ThemesColumns.MODIFIES_NAVIGATION_BAR,
"overlays/com.android.systemui");
+ sComponentToFolderName.put(ThemesColumns.MODIFIES_LIVE_LOCK_SCREEN,
+ "live-lockscreen");
}
public static boolean insertPackage(Context context, String pkgName, boolean isProcessing)
diff --git a/src/org/cyanogenmod/themes/provider/ThemesOpenHelper.java b/src/org/cyanogenmod/themes/provider/ThemesOpenHelper.java
index bcd8f04..4485362 100644
--- a/src/org/cyanogenmod/themes/provider/ThemesOpenHelper.java
+++ b/src/org/cyanogenmod/themes/provider/ThemesOpenHelper.java
@@ -36,7 +36,7 @@ import android.util.Log;
public class ThemesOpenHelper extends SQLiteOpenHelper {
private static final String TAG = ThemesOpenHelper.class.getName();
- private static final int DATABASE_VERSION = 17;
+ private static final int DATABASE_VERSION = 18;
private static final String DATABASE_NAME = "themes.db";
private static final String SYSTEM_THEME_PKG_NAME = ThemeConfig.SYSTEM_DEFAULT;
private static final String OLD_SYSTEM_THEME_PKG_NAME = "holo";
@@ -124,6 +124,10 @@ public class ThemesOpenHelper extends SQLiteOpenHelper {
upgradeToVersion17(db);
oldVersion = 17;
}
+ if (oldVersion == 17) {
+ upgradeToVersion18(db);
+ oldVersion = 18;
+ }
if (oldVersion != DATABASE_VERSION) {
Log.e(TAG, "Recreating db because unknown database version: " + oldVersion);
dropTables(db);
@@ -440,6 +444,21 @@ public class ThemesOpenHelper extends SQLiteOpenHelper {
db.execSQL(sql);
}
+ private void upgradeToVersion18(SQLiteDatabase db) {
+ // add install_state column to themes db
+ String sql = String.format("ALTER TABLE %s ADD COLUMN %s INTEGER DEFAULT 0",
+ ThemesTable.TABLE_NAME, ThemesColumns.MODIFIES_LIVE_LOCK_SCREEN);
+ db.execSQL(sql);
+
+ // add entry to mixnmatch table
+ ContentValues values = new ContentValues();
+ values.put(MixnMatchColumns.COL_VALUE, "");
+ values.put(MixnMatchColumns.COL_PREV_VALUE, "");
+ values.put(MixnMatchColumns.COL_UPDATE_TIME, 0);
+ values.put(MixnMatchColumns.COL_KEY, MixnMatchColumns.KEY_LIVE_LOCK_SCREEN);
+ 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);
@@ -477,6 +496,7 @@ public class ThemesOpenHelper extends SQLiteOpenHelper {
ThemesColumns.MODIFIES_OVERLAYS + " INTEGER DEFAULT 0, " +
ThemesColumns.MODIFIES_STATUS_BAR + " INTEGER DEFAULT 0, " +
ThemesColumns.MODIFIES_NAVIGATION_BAR + " INTEGER DEFAULT 0, " +
+ ThemesColumns.MODIFIES_LIVE_LOCK_SCREEN + " INTEGER DEFAULT 0, " +
ThemesColumns.PRESENT_AS_THEME + " INTEGER DEFAULT 0, " +
ThemesColumns.IS_LEGACY_THEME + " INTEGER DEFAULT 0, " +
ThemesColumns.IS_DEFAULT_THEME + " INTEGER DEFAULT 0, " +