Backup charging sounds enabled toggle correctly

Previously deprecated global settings property was overriding
the secure setting for charging_sounds_enabled. Only use the
global setting if the secure setting is unset (null).

Test: manual (repeat steps from bug)
Change-Id: I0bceab765764662855a053c82cb7251a14d4a1d8
Fixes: 119761984
This commit is contained in:
Beverly
2019-01-02 15:44:00 -05:00
committed by Beverly Tai
parent c54ffd28f7
commit ff9c587cc7

View File

@@ -4125,10 +4125,12 @@ public class SettingsProvider extends ContentProvider {
Secure.CHARGING_SOUNDS_ENABLED);
if (!globalChargingSoundEnabled.isNull()) {
secureSettings.insertSettingLocked(
Secure.CHARGING_SOUNDS_ENABLED,
globalChargingSoundEnabled.getValue(), null, false,
SettingsState.SYSTEM_PACKAGE_NAME);
if (secureChargingSoundsEnabled.isNull()) {
secureSettings.insertSettingLocked(
Secure.CHARGING_SOUNDS_ENABLED,
globalChargingSoundEnabled.getValue(), null, false,
SettingsState.SYSTEM_PACKAGE_NAME);
}
// set global charging_sounds_enabled setting to null since it's deprecated
globalSettings.insertSettingLocked(