CarrierConfigManager.GetConfigForSubId Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| GetConfigForSubId(Int32) |
Gets the configuration values for a particular subscription, which is associated with a specific SIM card. |
| GetConfigForSubId(Int32, String[]) |
Gets the configuration values of the specified keys for a particular subscription. |
GetConfigForSubId(Int32)
Gets the configuration values for a particular subscription, which is associated with a specific SIM card.
[Android.Runtime.Register("getConfigForSubId", "(I)Landroid/os/PersistableBundle;", "GetGetConfigForSubId_IHandler", ApiSince=23)]
[Android.Runtime.RequiresPermission("android.permission.READ_PHONE_STATE")]
public virtual Android.OS.PersistableBundle? GetConfigForSubId(int subId);
[<Android.Runtime.Register("getConfigForSubId", "(I)Landroid/os/PersistableBundle;", "GetGetConfigForSubId_IHandler", ApiSince=23)>]
[<Android.Runtime.RequiresPermission("android.permission.READ_PHONE_STATE")>]
abstract member GetConfigForSubId : int -> Android.OS.PersistableBundle
override this.GetConfigForSubId : int -> Android.OS.PersistableBundle
Parameters
- subId
- Int32
the subscription ID, normally obtained from SubscriptionManager.
Returns
A PersistableBundle containing the config for the given subId, or default
values for an invalid subId.
- Attributes
Remarks
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. After using this method to get the configuration bundle, #isConfigForIdentifiedCarrier(PersistableBundle) should be called to confirm whether any carrier specific configuration has been applied.
Requires Permission: android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE, or the calling app has carrier privileges (see TelephonyManager#hasCarrierPrivileges()).
This member is deprecated. Use #getConfigForSubId(int, String...) instead.
Java documentation for android.telephony.CarrierConfigManager.getConfigForSubId(int).
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
GetConfigForSubId(Int32, String[])
Gets the configuration values of the specified keys for a particular subscription.
[Android.Runtime.Register("getConfigForSubId", "(I[Ljava/lang/String;)Landroid/os/PersistableBundle;", "GetGetConfigForSubId_IarrayLjava_lang_String_Handler", ApiSince=34)]
public virtual Android.OS.PersistableBundle GetConfigForSubId(int subId, params string[] keys);
[<Android.Runtime.Register("getConfigForSubId", "(I[Ljava/lang/String;)Landroid/os/PersistableBundle;", "GetGetConfigForSubId_IarrayLjava_lang_String_Handler", ApiSince=34)>]
abstract member GetConfigForSubId : int * string[] -> Android.OS.PersistableBundle
override this.GetConfigForSubId : int * string[] -> Android.OS.PersistableBundle
Parameters
- subId
- Int32
The subscription ID on which the carrier config should be retrieved.
- keys
- String[]
The carrier config keys to retrieve values. This value cannot be null.
Returns
A PersistableBundle with key/value mapping for the specified configuration on success, or an empty (but never null) bundle on failure (for example, when the calling app has no permission).
- Attributes
Remarks
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. 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, isConfigForIdentifiedCarrier(PersistableBundle) should be called to confirm whether any carrier specific configuration has been applied. Note that on success, the key/value for KEY_CARRIER_CONFIG_VERSION_STRING and KEY_CARRIER_CONFIG_APPLIED_BOOL are always in the returned bundle, no matter if they were explicitly requested. Requires Permission: READ_PHONE_STATE, or the calling app has carrier privileges on the specified subscription (see TelephonyManager.hasCarrierPrivileges() ). Requires Manifest.permission.READ_PHONE_STATE or carrier privileges
Android reference for android.telephony.CarrierConfigManager.getConfigForSubId.
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.