Do not use DeviceConfig.getAllProperties().

Per b/362652574, we are removing this API, since it is troublesome
to maintain, and is not needed. Switch to making a direct bundle call.

Change-Id: I03729d8d36aef08a3005d8e420af7f07d3a778e1
Test: m
Bug: 362652574
Flag: EXEMPT trivial revert to previous behavior
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DeviceConfigService.java b/packages/SettingsProvider/src/com/android/providers/settings/DeviceConfigService.java
index bfbf41d..c9ad5a5 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DeviceConfigService.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DeviceConfigService.java
@@ -251,13 +251,22 @@
 
       public static HashMap<String, String> getAllFlags(IContentProvider provider) {
         HashMap<String, String> allFlags = new HashMap<String, String>();
-        for (DeviceConfig.Properties properties : DeviceConfig.getAllProperties()) {
-            List<String> keys = new ArrayList<>(properties.getKeyset());
-            for (String flagName : properties.getKeyset()) {
-                String fullName = properties.getNamespace() + "/" + flagName;
-                allFlags.put(fullName, properties.getString(flagName, null));
+        try {
+            Bundle args = new Bundle();
+            args.putInt(Settings.CALL_METHOD_USER_KEY,
+                ActivityManager.getService().getCurrentUser().id);
+            Bundle b = provider.call(new AttributionSource(Process.myUid(),
+                    resolveCallingPackage(), null), Settings.AUTHORITY,
+                    Settings.CALL_METHOD_LIST_CONFIG, null, args);
+            if (b != null) {
+                Map<String, String> flagsToValues =
+                    (HashMap) b.getSerializable(Settings.NameValueTable.VALUE);
+                allFlags.putAll(flagsToValues);
             }
+        } catch (RemoteException e) {
+            throw new RuntimeException("Failed in IPC", e);
         }
+
         return allFlags;
       }