Support key without default value for carrier config subset retrieval APIs

This CL implements carrier config subset retrieval APIs that was just
introduced to support config keys without default values.

For historical reasons, some AOSP public or OEMs/carriers private
carrier config keys didn't provide default values. When retrieving
configs with such key, the current implementation return empty
bundle which may break those user cases.

The right behavior is that keys without default values will be filtered
out, but other valid keys/values will be kept as is in the returned
bundle.

Bug: 244087782
Test: atest CarrirConfigManagerTest
Change-Id: I62ee536357f78caa8e95df2e4bf4a34f6bb845e5
diff --git a/src/com/android/phone/CarrierConfigLoader.java b/src/com/android/phone/CarrierConfigLoader.java
index 397ed35..a00fe98 100644
--- a/src/com/android/phone/CarrierConfigLoader.java
+++ b/src/com/android/phone/CarrierConfigLoader.java
@@ -1356,17 +1356,18 @@
         }
         for (String key : keys) {
             Objects.requireNonNull(key, "Config key must be non-null");
-            // TODO(b/261776046): validate provided key which may has no default value.
-            // For now, return empty bundle if any required key is not supported
-            if (!allConfigs.containsKey(key)) {
-                return new PersistableBundle();
-            }
         }
 
         PersistableBundle configSubset = new PersistableBundle(
                 keys.length + CONFIG_SUBSET_METADATA_KEYS.length);
         for (String carrierConfigKey : keys) {
             Object value = allConfigs.get(carrierConfigKey);
+            if (value == null) {
+                // Filter out keys without values.
+                // In history, many AOSP or OEMs/carriers private configs didn't provide default
+                // values. We have to continue supporting them for now. See b/261776046 for details.
+                continue;
+            }
             // Config value itself could be PersistableBundle which requires different API to put
             if (value instanceof PersistableBundle) {
                 configSubset.putPersistableBundle(carrierConfigKey, (PersistableBundle) value);