summaryrefslogtreecommitdiffstats
path: root/packages/SettingsProvider/src/com
diff options
context:
space:
mode:
authorAdrian Roos <roosa@google.com>2014-08-13 17:14:51 +0200
committerAdrian Roos <roosa@google.com>2014-08-18 16:53:27 +0000
commit49e057d7eedb44f5397781254acab4e0ef08a9cf (patch)
tree5ba51bd4faf957aa4848c8ecd3b7fbecd7ab5723 /packages/SettingsProvider/src/com
parent9eee9dca63dfd596197b58011b85d9daa6f39f06 (diff)
downloadframeworks_base-49e057d7eedb44f5397781254acab4e0ef08a9cf.zip
frameworks_base-49e057d7eedb44f5397781254acab4e0ef08a9cf.tar.gz
frameworks_base-49e057d7eedb44f5397781254acab4e0ef08a9cf.tar.bz2
Play "device trusted" sound when onTrustInitiatedByUser fires
Bug: 16840500 Change-Id: I73fbe5c2cff665ccb637abb9039d57f377d9df53
Diffstat (limited to 'packages/SettingsProvider/src/com')
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index 7c92cde..13301fb 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 = 106;
+ private static final int DATABASE_VERSION = 107;
private Context mContext;
private int mUserHandle;
@@ -1694,6 +1694,26 @@ public class DatabaseHelper extends SQLiteOpenHelper {
}
upgradeVersion = 106;
}
+
+ if (upgradeVersion < 107) {
+ // Add trusted sound setting
+ if (mUserHandle == UserHandle.USER_OWNER) {
+ db.beginTransaction();
+ SQLiteStatement stmt = null;
+ try {
+ stmt = db.compileStatement("INSERT OR REPLACE INTO global(name,value)"
+ + " VALUES(?,?);");
+ loadStringSetting(stmt, Settings.Global.TRUSTED_SOUND,
+ R.string.def_trusted_sound);
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ if (stmt != null) stmt.close();
+ }
+ }
+ upgradeVersion = 107;
+ }
+
// *** Remember to update DATABASE_VERSION above!
if (upgradeVersion != currentVersion) {
@@ -2373,6 +2393,8 @@ public class DatabaseHelper extends SQLiteOpenHelper {
R.string.def_lock_sound);
loadStringSetting(stmt, Settings.Global.UNLOCK_SOUND,
R.string.def_unlock_sound);
+ loadStringSetting(stmt, Settings.Global.TRUSTED_SOUND,
+ R.string.def_trusted_sound);
loadIntegerSetting(stmt, Settings.Global.POWER_SOUNDS_ENABLED,
R.integer.def_power_sounds_enabled);
loadStringSetting(stmt, Settings.Global.LOW_BATTERY_SOUND,