diff options
author | Chris Wren <cwren@android.com> | 2014-08-29 21:25:42 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-29 21:25:43 +0000 |
commit | 4775109ec1e08092befa836078ecc76eee773e33 (patch) | |
tree | 17fec35ed6447e6d867c37eae160c46d0ddf3768 /packages/SettingsProvider | |
parent | 68245c074c0592284b89253c4ea662d0fa76cf90 (diff) | |
parent | cd8f4f71fc75b4f57d21c4e9f80f1107101ca369 (diff) | |
download | frameworks_base-4775109ec1e08092befa836078ecc76eee773e33.zip frameworks_base-4775109ec1e08092befa836078ecc76eee773e33.tar.gz frameworks_base-4775109ec1e08092befa836078ecc76eee773e33.tar.bz2 |
Merge "Disable lockscreen notifications for secure users on upgrade." into lmp-dev
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/res/values/defaults.xml | 3 | ||||
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java | 25 |
2 files changed, 25 insertions, 3 deletions
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index 299e50c..a3bed4f 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -187,6 +187,9 @@ <!-- Default for Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 1==on --> <integer name="def_lock_screen_show_notifications">1</integer> + <!-- Default for Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS --> + <bool name="def_lock_screen_allow_private_notifications">true</bool> + <!-- Default for Settings.Global.HEADS_UP_NOTIFICATIONS_ENABLED, 1==on --> <integer name="def_heads_up_enabled">1</integer> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index edefb13..fd5e6fe 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 = 108; + private static final int DATABASE_VERSION = 109; private Context mContext; private int mUserHandle; @@ -1673,8 +1673,8 @@ public class DatabaseHelper extends SQLiteOpenHelper { try { stmt = db.compileStatement("INSERT OR IGNORE INTO secure(name,value)" + " VALUES(?,?);"); - loadBooleanSetting(stmt, Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, - R.bool.def_guest_user_enabled); + loadIntegerSetting(stmt, Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, + R.integer.def_lock_screen_show_notifications); if (mUserHandle == UserHandle.USER_OWNER) { final int oldShow = getIntValueFromTable(db, TABLE_GLOBAL, Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, -1); @@ -1733,6 +1733,22 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 108; } + if (upgradeVersion < 109) { + db.beginTransaction(); + SQLiteStatement stmt = null; + try { + stmt = db.compileStatement("INSERT OR IGNORE INTO secure(name,value)" + + " VALUES(?,?);"); + loadBooleanSetting(stmt, Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, + R.bool.def_lock_screen_allow_private_notifications); + db.setTransactionSuccessful(); + } finally { + db.endTransaction(); + if (stmt != null) stmt.close(); + } + upgradeVersion = 109; + } + // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { @@ -2301,6 +2317,9 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadIntegerSetting(stmt, Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, R.integer.def_lock_screen_show_notifications); + loadBooleanSetting(stmt, Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, + R.bool.def_lock_screen_allow_private_notifications); + } finally { if (stmt != null) stmt.close(); } |