Store original values of replaced settings in Settings.Secure

Bug: 153940088
Test: atest SettingsProviderTest:SettingsHelperTest

Writing new settings to Settings.System is only available to privileged
callers. Move the storage of the original values of replaced settings to
Settings.Secure. See the attached bug for more context on replaced
settings.

Change-Id: I8f1e8e88da4766b5fca9362cdbe88d93b964db9b
This commit is contained in:
Ruslan Tkhakokhov
2020-06-15 17:21:38 +01:00
parent addcaf9f51
commit 52669b0720

View File

@@ -219,7 +219,9 @@ public class SettingsHelper {
*/
@VisibleForTesting
public String getRealValueForSystemSetting(String setting) {
return Settings.System.getString(mContext.getContentResolver(),
// The real value irrespectively of the original setting's namespace is stored in
// Settings.Secure.
return Settings.Secure.getString(mContext.getContentResolver(),
setting + SETTING_ORIGINAL_KEY_SUFFIX);
}