diff options
author | Roman Birg <roman@cyngn.com> | 2016-04-15 13:15:33 -0700 |
---|---|---|
committer | Roman Birg <roman@cyngn.com> | 2016-04-22 08:29:38 -0700 |
commit | bf5261c360cb64b9a821d48210173d487ad7b3b8 (patch) | |
tree | 3addec7c268826919fc9475e33bc416142c48d25 /packages/CMSettingsProvider | |
parent | 7a4fed964039231e3f8ede0e7835c3294b93d129 (diff) | |
download | vendor_cmsdk-bf5261c360cb64b9a821d48210173d487ad7b3b8.zip vendor_cmsdk-bf5261c360cb64b9a821d48210173d487ad7b3b8.tar.gz vendor_cmsdk-bf5261c360cb64b9a821d48210173d487ad7b3b8.tar.bz2 |
CMSettings: add CM_SETUP_WIZARD_COMPLETED key
We need to store the state of _our_ setup wizard.
To not break existing devices' provisioning, copy the current state of the global
provisioned flag to the new key value.
Ticket: CYNGNOS-2431
Change-Id: I3d88361edc126788f42b28efd11f3c7598117138
Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'packages/CMSettingsProvider')
-rw-r--r-- | packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java index 98064af..34fa4cb 100644 --- a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java +++ b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java @@ -46,7 +46,7 @@ public class CMDatabaseHelper extends SQLiteOpenHelper{ private static final boolean LOCAL_LOGV = false; private static final String DATABASE_NAME = "cmsettings.db"; - private static final int DATABASE_VERSION = 3; + private static final int DATABASE_VERSION = 4; public static class CMTableNames { public static final String TABLE_SYSTEM = "system"; @@ -184,6 +184,23 @@ public class CMDatabaseHelper extends SQLiteOpenHelper{ upgradeVersion = 3; } + if (upgradeVersion < 4) { + db.beginTransaction(); + SQLiteStatement stmt = null; + try { + stmt = db.compileStatement("INSERT INTO secure(name,value)" + + " VALUES(?,?);"); + loadSetting(stmt, CMSettings.Secure.CM_SETUP_WIZARD_COMPLETED, + Settings.Global.getString(mContext.getContentResolver(), + Settings.Global.DEVICE_PROVISIONED)); + db.setTransactionSuccessful(); + } finally { + if (stmt != null) stmt.close(); + db.endTransaction(); + } + upgradeVersion = 4; + } + // *** Remember to update DATABASE_VERSION above! if (upgradeVersion < newVersion) { |