diff options
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/res/values/defaults.xml | 1 | ||||
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java | 24 |
2 files changed, 24 insertions, 1 deletions
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index 478a5de..299e50c 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -73,6 +73,7 @@ <integer name="def_lockscreen_sounds_enabled">1</integer> <string name="def_lock_sound" translatable="false">/system/media/audio/ui/Lock.ogg</string> <string name="def_unlock_sound" translatable="false">/system/media/audio/ui/Unlock.ogg</string> + <string name="def_trusted_sound" translatable="false">/system/media/audio/ui/Trusted.ogg</string> <string name="def_wireless_charging_started_sound" translatable="false">/system/media/audio/ui/WirelessChargingStarted.ogg</string> <bool name="def_lockscreen_disabled">false</bool> 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, |