diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-01-29 10:38:29 -0800 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2010-01-29 17:16:02 -0800 |
commit | 9327f4f671de3cbb795612bf4f314ceff88de865 (patch) | |
tree | f6f1109e4b3c8966eb6747f6f73835ea0623312e /packages/SettingsProvider | |
parent | 7912a29cf24cab2f999186d95afa13ecdada0b8e (diff) | |
download | frameworks_base-9327f4f671de3cbb795612bf4f314ceff88de865.zip frameworks_base-9327f4f671de3cbb795612bf4f314ceff88de865.tar.gz frameworks_base-9327f4f671de3cbb795612bf4f314ceff88de865.tar.bz2 |
More device policy work: clarify password modes, monkeying.
Clarifies what the password modes mean, renaming them to "quality"
and updating their documentation and the implementation to follow.
Also adds a facility to find out if a monkey is running, which I
need for the api demo to avoid letting it wipe the device.
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index 979955c..015b487 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -71,7 +71,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { // database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion' // is properly propagated through your change. Not doing so will result in a loss of user // settings. - private static final int DATABASE_VERSION = 47; + private static final int DATABASE_VERSION = 48; private Context mContext; @@ -595,8 +595,23 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 47; } + + if (upgradeVersion == 47) { + /* + * The password mode constants have changed again; reset back to no + * password. + */ + db.beginTransaction(); + try { + db.execSQL("DELETE FROM system WHERE name='lockscreen.password_type';"); + db.setTransactionSuccessful(); + } finally { + db.endTransaction(); + } + upgradeVersion = 48; + } - if (upgradeVersion != currentVersion) { + if (upgradeVersion != currentVersion) { Log.w(TAG, "Got stuck trying to upgrade from version " + upgradeVersion + ", must wipe the settings provider"); db.execSQL("DROP TABLE IF EXISTS system"); |