summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2014-05-27 20:57:24 -0700
committerJeff Brown <jeffbrown@google.com>2014-05-29 15:22:40 -0700
commita20dda4a6eedeee1dcaf105d76c8d7d126ce0f1b (patch)
tree22ac81034f8003ef7962fdbbf670ccc8bbccab98 /packages
parentd5f0a116a2b0a6de447df00bfbe91cf66ad4286e (diff)
downloadframeworks_base-a20dda4a6eedeee1dcaf105d76c8d7d126ce0f1b.zip
frameworks_base-a20dda4a6eedeee1dcaf105d76c8d7d126ce0f1b.tar.gz
frameworks_base-a20dda4a6eedeee1dcaf105d76c8d7d126ce0f1b.tar.bz2
Add support for wake gestures.
Bug: 15137158 Change-Id: I171c3269a7a16a00083e16e1cc4c7c1c2b98c05e
Diffstat (limited to 'packages')
-rw-r--r--packages/SettingsProvider/res/values/defaults.xml3
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java22
2 files changed, 24 insertions, 1 deletions
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
index bf97fc0..0e025a9 100644
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -192,4 +192,7 @@
<!-- Default for Settings.Global.DEVICE_NAME $1=BRAND $2=MODEL-->
<string name="def_device_name">%1$s %2$s</string>
+ <!-- Default for Settings.Secure.WAKE_GESTURE_ENABLED -->
+ <bool name="def_wake_gesture_enabled">true</bool>
+
</resources>
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index 286921e..c4a54b7 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -70,7 +70,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 = 103;
+ private static final int DATABASE_VERSION = 104;
private Context mContext;
private int mUserHandle;
@@ -1660,6 +1660,23 @@ public class DatabaseHelper extends SQLiteOpenHelper {
}
upgradeVersion = 103;
}
+
+ if (upgradeVersion == 103) {
+ db.beginTransaction();
+ SQLiteStatement stmt = null;
+ try {
+ stmt = db.compileStatement("INSERT OR REPLACE INTO secure(name,value)"
+ + " VALUES(?,?);");
+ loadBooleanSetting(stmt, Settings.Secure.WAKE_GESTURE_ENABLED,
+ R.bool.def_wake_gesture_enabled);
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ if (stmt != null) stmt.close();
+ }
+ upgradeVersion = 104;
+ }
+
// *** Remember to update DATABASE_VERSION above!
if (upgradeVersion != currentVersion) {
@@ -2222,6 +2239,9 @@ public class DatabaseHelper extends SQLiteOpenHelper {
loadBooleanSetting(stmt, Settings.Secure.INSTALL_NON_MARKET_APPS,
R.bool.def_install_non_market_apps);
+ loadBooleanSetting(stmt, Settings.Secure.WAKE_GESTURE_ENABLED,
+ R.bool.def_wake_gesture_enabled);
+
} finally {
if (stmt != null) stmt.close();
}