From 1cdd7dda61b30358c843e534394c32f24bc5271f Mon Sep 17 00:00:00 2001 From: Chris Wren Date: Fri, 28 Feb 2014 17:49:20 -0500 Subject: enable heads up notifications Bug: 13208692 Change-Id: I3682ecb30c6997c578b76a578b79a8d13a6e6323 --- .../android/providers/settings/DatabaseHelper.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'packages/SettingsProvider/src/com') 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) { -- cgit v1.1