From afc9665161ad497d1c30d19ea42b3b83ab697b6d Mon Sep 17 00:00:00 2001 From: rambowang Date: Tue, 13 Dec 2022 18:08:36 -0600 Subject: [PATCH] Update javadoc of the newly introduced CarrirConfigManager APIs This CL updates the javadoc of the newly introduced carrier config subset retrieval APIs to support 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: I0f5593f8b5ba54bcd679be26a9a8db31ac33b461 --- .../java/android/telephony/CarrierConfigManager.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 91036587320b1..477ce4a4791c4 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -9986,7 +9986,8 @@ public class CarrierConfigManager { * Gets the configuration values of the specified keys for a particular subscription. * *

If an invalid subId is used, the returned configuration will contain default values for - * the specified keys. + * the specified keys. If the value for the key can't be found, the returned configuration will + * filter the key out. * *

After using this method to get the configuration bundle, * {@link #isConfigForIdentifiedCarrier(PersistableBundle)} should be called to confirm whether @@ -10004,8 +10005,8 @@ public class CarrierConfigManager { * @param subId The subscription ID on which the carrier config should be retrieved. * @param keys The carrier config keys to retrieve values. * @return A {@link PersistableBundle} with key/value mapping for the specified configuration - * on success, or an empty (but never null) bundle on failure (for example, when no value for - * the specified key can be found). + * on success, or an empty (but never null) bundle on failure (for example, when the calling app + * has no permission). */ @RequiresPermission(anyOf = { Manifest.permission.READ_PHONE_STATE, @@ -10123,6 +10124,8 @@ public class CarrierConfigManager { * Gets the configuration values of the specified config keys applied for the default * subscription. * + *

If the value for the key can't be found, the returned bundle will filter the key out. + * *

After using this method to get the configuration bundle, {@link * #isConfigForIdentifiedCarrier(PersistableBundle)} should be called to confirm whether any * carrier specific configuration has been applied.