Move namespace/prefix logic to Settings.Config.
Previously DeviceConfig, Settings.Config, and SettingsProvider needed to
understand how to append "/" to a namespace to create the prefix for key
names before saving them in SettingsProvider. This removes that
duplication and lets all of the compositing and decompositing happen in
Settings.Config.
Test: atest FrameworksCoreTests:DeviceConfigTest
atest FrameworksCoreTests:SettingsProviderTest
atest SettingsProviderTest:DeviceConfigServiceTest
Bug: 136135417
Change-Id: I126155594f3e764e149a4928d1b3708da68c97f4
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index fdc987f..7765935 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -2115,10 +2115,7 @@
}
private static String getSettingPrefix(Bundle args) {
- String prefix = (args != null) ? args.getString(Settings.CALL_METHOD_PREFIX_KEY) : null;
- // Append '/' to ensure we only match properties with this exact prefix.
- // i.e. "foo" should match "foo/property" but not "foobar/property"
- return prefix != null ? prefix + "/" : null;
+ return (args != null) ? args.getString(Settings.CALL_METHOD_PREFIX_KEY) : null;
}
private static boolean getSettingMakeDefault(Bundle args) {