summaryrefslogtreecommitdiffstats
path: root/packages/SettingsProvider
diff options
context:
space:
mode:
authorChris Wren <cwren@android.com>2014-02-28 17:49:20 -0500
committerChris Wren <cwren@android.com>2014-03-03 10:15:53 -0500
commit1cdd7dda61b30358c843e534394c32f24bc5271f (patch)
tree7b9ebbb9d87a72cc5dba05937ec5e962c135690e /packages/SettingsProvider
parent10d82dfbfb4bcc0899bd1e8dc04e97c2ea39a752 (diff)
downloadframeworks_base-1cdd7dda61b30358c843e534394c32f24bc5271f.zip
frameworks_base-1cdd7dda61b30358c843e534394c32f24bc5271f.tar.gz
frameworks_base-1cdd7dda61b30358c843e534394c32f24bc5271f.tar.bz2
enable heads up notifications
Bug: 13208692 Change-Id: I3682ecb30c6997c578b76a578b79a8d13a6e6323
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r--packages/SettingsProvider/res/values/defaults.xml3
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java20
2 files changed, 22 insertions, 1 deletions
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
index 7410b9d..59b486f 100644
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -186,4 +186,7 @@
<!-- Default for Settings.Global.LOCK_SCREEN_SHOW_NOTIFICATIONS, 1==on -->
<integer name="def_lock_screen_show_notifications">1</integer>
+ <!-- Default for Settings.Global.HEADS_UP_NOTIFICATIONS_ENABLED, 1==on -->
+ <integer name="def_heads_up_enabled">1</integer>
+
</resources>
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index b546689..55d7def 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -69,7 +69,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 = 99;
+ private static final int DATABASE_VERSION = 100;
private Context mContext;
private int mUserHandle;
@@ -1574,6 +1574,24 @@ public class DatabaseHelper extends SQLiteOpenHelper {
upgradeVersion = 99;
}
+ if (upgradeVersion == 99) {
+ if (mUserHandle == UserHandle.USER_OWNER) {
+ db.beginTransaction();
+ SQLiteStatement stmt = null;
+ try {
+ stmt = db.compileStatement("INSERT OR REPLACE INTO global(name,value)"
+ + " VALUES(?,?);");
+ loadIntegerSetting(stmt, Global.HEADS_UP_NOTIFICATIONS_ENABLED,
+ R.integer.def_heads_up_enabled);
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ if (stmt != null) stmt.close();
+ }
+ }
+ upgradeVersion = 100;
+ }
+
// *** Remember to update DATABASE_VERSION above!
if (upgradeVersion != currentVersion) {