From 9327f4f671de3cbb795612bf4f314ceff88de865 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Fri, 29 Jan 2010 10:38:29 -0800 Subject: 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. --- .../android/providers/settings/DatabaseHelper.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'packages') 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"); -- cgit v1.1