Sdílet prostřednictvím


CarrierConfigManager.IsConfigForIdentifiedCarrier(PersistableBundle) Method

Definition

Determines whether a configuration PersistableBundle obtained from #getConfig() or #getConfigForSubId(int) corresponds to an identified carrier.

[Android.Runtime.Register("isConfigForIdentifiedCarrier", "(Landroid/os/PersistableBundle;)Z", "", ApiSince=28)]
public static bool IsConfigForIdentifiedCarrier (Android.OS.PersistableBundle? bundle);
[<Android.Runtime.Register("isConfigForIdentifiedCarrier", "(Landroid/os/PersistableBundle;)Z", "", ApiSince=28)>]
static member IsConfigForIdentifiedCarrier : Android.OS.PersistableBundle -> bool

Parameters

bundle
PersistableBundle

the configuration bundle to be checked.

Returns

boolean true if any carrier specific configuration bundle has been applied, false otherwise or the bundle is null.

Attributes

Remarks

Determines whether a configuration PersistableBundle obtained from #getConfig() or #getConfigForSubId(int) corresponds to an identified carrier.

When an app receives the 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 #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 #getConfig() or #getConfigForSubId(int) after receiving the broadcast #ACTION_CARRIER_CONFIG_CHANGED.

After using #getConfig() or #getConfigForSubId(int) an app should always use this method to confirm whether any carrier specific configuration has been applied. Especially when an app misses the broadcast #ACTION_CARRIER_CONFIG_CHANGED but it still needs to get the current configuration, it must use this method to verify whether the configuration is default or carrier overridden.

Java documentation for android.telephony.CarrierConfigManager.isConfigForIdentifiedCarrier(android.os.PersistableBundle).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to