diff options
| -rw-r--r-- | api/current.txt | 6 | ||||
| -rw-r--r-- | api/system-current.txt | 6 | ||||
| -rw-r--r-- | api/test-current.txt | 6 | ||||
| -rw-r--r-- | telephony/java/android/telephony/CarrierConfigManager.java | 44 |
4 files changed, 54 insertions, 8 deletions
diff --git a/api/current.txt b/api/current.txt index 646c56e9a72d..bea0cf867006 100644 --- a/api/current.txt +++ b/api/current.txt @@ -36509,9 +36509,11 @@ package android.telecom { package android.telephony { public class CarrierConfigManager { + method public android.os.PersistableBundle getConfig(int); method public android.os.PersistableBundle getConfig(); - method public android.os.PersistableBundle getConfigForSubId(int); - method public void notifyConfigChangedForSubId(int); + method public deprecated android.os.PersistableBundle getConfigForSubId(int); + method public void notifyConfigChanged(int); + method public deprecated void notifyConfigChangedForSubId(int); field public static final java.lang.String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED"; field public static final java.lang.String BOOL_ALLOW_EMERGENCY_VIDEO_CALLS = "bool_allow_emergency_video_calls"; field public static final java.lang.String BOOL_ALLOW_VIDEO_PAUSE = "bool_allow_video_pause"; diff --git a/api/system-current.txt b/api/system-current.txt index 52460bc8aaaf..150dec7f39e4 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -39224,10 +39224,12 @@ package android.telecom { package android.telephony { public class CarrierConfigManager { + method public android.os.PersistableBundle getConfig(int); method public android.os.PersistableBundle getConfig(); - method public android.os.PersistableBundle getConfigForSubId(int); + method public deprecated android.os.PersistableBundle getConfigForSubId(int); method public static android.os.PersistableBundle getDefaultConfig(); - method public void notifyConfigChangedForSubId(int); + method public void notifyConfigChanged(int); + method public deprecated void notifyConfigChangedForSubId(int); method public void updateConfigForPhoneId(int, java.lang.String); field public static final java.lang.String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED"; field public static final java.lang.String BOOL_ALLOW_EMERGENCY_VIDEO_CALLS = "bool_allow_emergency_video_calls"; diff --git a/api/test-current.txt b/api/test-current.txt index 6f40052a44a6..38c17d2ddd1b 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -36524,9 +36524,11 @@ package android.telecom { package android.telephony { public class CarrierConfigManager { + method public android.os.PersistableBundle getConfig(int); method public android.os.PersistableBundle getConfig(); - method public android.os.PersistableBundle getConfigForSubId(int); - method public void notifyConfigChangedForSubId(int); + method public deprecated android.os.PersistableBundle getConfigForSubId(int); + method public void notifyConfigChanged(int); + method public deprecated void notifyConfigChangedForSubId(int); field public static final java.lang.String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED"; field public static final java.lang.String BOOL_ALLOW_EMERGENCY_VIDEO_CALLS = "bool_allow_emergency_video_calls"; field public static final java.lang.String BOOL_ALLOW_VIDEO_PAUSE = "bool_allow_video_pause"; diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 3ad7d34f6ff1..1278c07897f5 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -733,9 +733,28 @@ public class CarrierConfigManager { * @param subId the subscription ID, normally obtained from {@link SubscriptionManager}. * @return A {@link PersistableBundle} containing the config for the given subId, or default * values for an invalid subId. + * + * @deprecated use getConfig. */ @Nullable public PersistableBundle getConfigForSubId(int subId) { + return getConfig(subId); + } + + /** + * Gets the configuration values for a particular subscription, which is associated with a + * specific SIM card. If an invalid subId is used, the returned config will contain default + * values. + * + * <p>Requires Permission: + * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} + * + * @param subId the subscription ID, normally obtained from {@link SubscriptionManager}. + * @return A {@link PersistableBundle} containing the config for the given subId, or default + * values for an invalid subId. + */ + @Nullable + public PersistableBundle getConfig(int subId) { try { ICarrierConfigLoader loader = getICarrierConfigLoader(); if (loader == null) { @@ -757,11 +776,11 @@ public class CarrierConfigManager { * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * - * @see #getConfigForSubId + * @return A {@link PersistableBundle} containing the config for the default subscription. */ @Nullable public PersistableBundle getConfig() { - return getConfigForSubId(SubscriptionManager.getDefaultSubscriptionId()); + return getConfig(SubscriptionManager.getDefaultSubscriptionId()); } /** @@ -778,8 +797,29 @@ public class CarrierConfigManager { * {@link android.service.carrier.CarrierService#onLoadConfig} will be called from an * arbitrary thread. * </p> + * + * @deprecated use notifyConfigChanged. */ public void notifyConfigChangedForSubId(int subId) { + notifyConfigChanged(subId); + } + + /** + * Calling this method triggers telephony services to fetch the current carrier configuration. + * <p> + * Normally this does not need to be called because the platform reloads config on its own. + * This should be called by a carrier service app if it wants to update config at an arbitrary + * moment. + * </p> + * <p>Requires that the calling app has carrier privileges. + * @see #hasCarrierPrivileges + * <p> + * This method returns before the reload has completed, and + * {@link android.service.carrier.CarrierService#onLoadConfig} will be called from an + * arbitrary thread. + * </p> + */ + public void notifyConfigChanged(int subId) { try { ICarrierConfigLoader loader = getICarrierConfigLoader(); if (loader == null) { |