Merge "Add new key KEY_CARRIER_CONFIG_OVERRIDE_BOOL" am: 7be7d422a2

am: 784a690ec7

Change-Id: I0e4098cfd0fe0d78e2d5de33a193da1095974ea6
This commit is contained in:
Ying Xu
2017-12-18 23:42:03 +00:00
committed by android-build-merger
2 changed files with 36 additions and 0 deletions

View File

@@ -39753,6 +39753,7 @@ package android.telephony {
public class CarrierConfigManager {
method public android.os.PersistableBundle getConfig();
method public android.os.PersistableBundle getConfigForSubId(int);
method public static boolean isConfigForIdentifiedCarrier(android.os.PersistableBundle);
method public void notifyConfigChangedForSubId(int);
field public static final java.lang.String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED";
field public static final int DATA_CYCLE_THRESHOLD_DISABLED = -2; // 0xfffffffe

View File

@@ -1712,6 +1712,13 @@ public class CarrierConfigManager {
public static final String KEY_SPN_DISPLAY_RULE_USE_ROAMING_FROM_SERVICE_STATE_BOOL =
"spn_display_rule_use_roaming_from_service_state_bool";
/**
* Determines whether any carrier has been identified and its specific config has been applied,
* default to false.
* @hide
*/
public static final String KEY_CARRIER_CONFIG_APPLIED_BOOL = "carrier_config_applied_bool";
/** The default value for every variable. */
private final static PersistableBundle sDefaults;
@@ -1995,6 +2002,7 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_IDENTIFY_HIGH_DEFINITION_CALLS_IN_CALL_LOG_BOOL, false);
sDefaults.putBoolean(KEY_SPN_DISPLAY_RULE_USE_ROAMING_FROM_SERVICE_STATE_BOOL, false);
sDefaults.putBoolean(KEY_ALWAYS_SHOW_DATA_RAT_ICON_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_CONFIG_APPLIED_BOOL, false);
}
/**
@@ -2039,6 +2047,33 @@ public class CarrierConfigManager {
return getConfigForSubId(SubscriptionManager.getDefaultSubscriptionId());
}
/**
* Determines whether a configuration {@link PersistableBundle} obtained from
* {@link #getConfig()} or {@link #getConfigForSubId(int)} corresponds to an identified carrier.
* <p>
* When an app receives the {@link CarrierConfigManager#ACTION_CARRIER_CONFIG_CHANGED}
* broadcast which informs it that the carrier configuration has changed, it is possible
* that another reload of the carrier configuration has begun since the intent was sent.
* In this case, the carrier configuration the app fetches (e.g. via {@link #getConfig()})
* may not represent the configuration for the current carrier. It should be noted that it
* does not necessarily mean the configuration belongs to current carrier when this function
* return true because it may belong to another previous identified carrier. Users should
* always call {@link #getConfig()} or {@link #getConfigForSubId(int)} after receiving the
* broadcast {@link #ACTION_CARRIER_CONFIG_CHANGED}.
* </p>
* <p>
* After using {@link #getConfig()} or {@link #getConfigForSubId(int)} an app should always
* use this method to confirm whether any carrier specific configuration has been applied.
* </p>
*
* @param bundle the configuration bundle to be checked.
* @return boolean true if any carrier specific configuration bundle has been applied, false
* otherwise or the bundle is null.
*/
public static boolean isConfigForIdentifiedCarrier(PersistableBundle bundle) {
return bundle != null && bundle.getBoolean(KEY_CARRIER_CONFIG_APPLIED_BOOL);
}
/**
* Calling this method triggers telephony services to fetch the current carrier configuration.
* <p>