CarrierService.OnLoadConfig Method

Definition

Overloads

OnLoadConfig(CarrierIdentifier)

Override this method to set carrier configuration.

OnLoadConfig(Int32, CarrierIdentifier)

Override this method to set carrier configuration on the given subscriptionId.

OnLoadConfig(CarrierIdentifier)

Override this method to set carrier configuration.

[Android.Runtime.Register("onLoadConfig", "(Landroid/service/carrier/CarrierIdentifier;)Landroid/os/PersistableBundle;", "GetOnLoadConfig_Landroid_service_carrier_CarrierIdentifier_Handler", ApiSince=23)]
public abstract Android.OS.PersistableBundle? OnLoadConfig (Android.Service.Carrier.CarrierIdentifier? id);
[<Android.Runtime.Register("onLoadConfig", "(Landroid/service/carrier/CarrierIdentifier;)Landroid/os/PersistableBundle;", "GetOnLoadConfig_Landroid_service_carrier_CarrierIdentifier_Handler", ApiSince=23)>]
abstract member OnLoadConfig : Android.Service.Carrier.CarrierIdentifier -> Android.OS.PersistableBundle

Parameters

id
CarrierIdentifier

contains details about the current carrier that can be used to decide what configuration values to return. Instead of using details like MCCMNC to decide current carrier, it also contains subscription carrier id android.telephony.TelephonyManager#getSimCarrierId(), a platform-wide unique identifier for each carrier, CarrierConfigService can directly use carrier id as the key to look up the carrier info.

Returns

a PersistableBundle object containing the configuration or null if default values should be used.

Attributes

Remarks

Override this method to set carrier configuration.

This method will be called by telephony services to get carrier-specific configuration values. The returned config will be saved by the system until, <ol> <li>The carrier app package is updated, or</li> <li>The carrier app requests a reload with android.telephony.CarrierConfigManager#notifyConfigChangedForSubId notifyConfigChangedForSubId.</li> </ol> This method can be called after a SIM card loads, which may be before or after boot.

This method should not block for a long time. If expensive operations (e.g. network access) are required, this method can schedule the work and return null. Then, use android.telephony.CarrierConfigManager#notifyConfigChangedForSubId notifyConfigChangedForSubId to trigger a reload when the config is ready.

Implementations should use the keys defined in android.telephony.CarrierConfigManager CarrierConfigManager. Any configuration values not set in the returned PersistableBundle may be overridden by the system's default configuration service.

This member is deprecated. use #onLoadConfig(int, CarrierIdentifier) instead.

Java documentation for android.service.carrier.CarrierService.onLoadConfig(android.service.carrier.CarrierIdentifier).

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

OnLoadConfig(Int32, CarrierIdentifier)

Override this method to set carrier configuration on the given subscriptionId.

[Android.Runtime.Register("onLoadConfig", "(ILandroid/service/carrier/CarrierIdentifier;)Landroid/os/PersistableBundle;", "GetOnLoadConfig_ILandroid_service_carrier_CarrierIdentifier_Handler", ApiSince=33)]
public virtual Android.OS.PersistableBundle? OnLoadConfig (int subscriptionId, Android.Service.Carrier.CarrierIdentifier? id);
[<Android.Runtime.Register("onLoadConfig", "(ILandroid/service/carrier/CarrierIdentifier;)Landroid/os/PersistableBundle;", "GetOnLoadConfig_ILandroid_service_carrier_CarrierIdentifier_Handler", ApiSince=33)>]
abstract member OnLoadConfig : int * Android.Service.Carrier.CarrierIdentifier -> Android.OS.PersistableBundle
override this.OnLoadConfig : int * Android.Service.Carrier.CarrierIdentifier -> Android.OS.PersistableBundle

Parameters

subscriptionId
Int32

the subscription on which the carrier app should load configuration

id
CarrierIdentifier

contains details about the current carrier that can be used to decide what configuration values to return. Instead of using details like MCCMNC to decide current carrier, it also contains subscription carrier id android.telephony.TelephonyManager#getSimCarrierId(), a platform-wide unique identifier for each carrier, CarrierConfigService can directly use carrier id as the key to look up the carrier info.

Returns

a PersistableBundle object containing the configuration or null if default values should be used.

Attributes

Remarks

Override this method to set carrier configuration on the given subscriptionId.

This method will be called by telephony services to get carrier-specific configuration values. The returned config will be saved by the system until, <ol> <li>The carrier app package is updated, or</li> <li>The carrier app requests a reload with android.telephony.CarrierConfigManager#notifyConfigChangedForSubId notifyConfigChangedForSubId.</li> </ol> This method can be called after a SIM card loads, which may be before or after boot.

This method should not block for a long time. If expensive operations (e.g. network access) are required, this method can schedule the work and return null. Then, use android.telephony.CarrierConfigManager#notifyConfigChangedForSubId notifyConfigChangedForSubId to trigger a reload when the config is ready.

Implementations should use the keys defined in android.telephony.CarrierConfigManager CarrierConfigManager. Any configuration values not set in the returned PersistableBundle may be overridden by the system's default configuration service.

By default, this method just calls #onLoadConfig(CarrierIdentifier) with specified CarrierIdentifier id. Carrier app with target SDK android.os.Build.VERSION_CODES#TIRAMISU and above should override this method to load carrier configuration on the given subscriptionId. Note that #onLoadConfig(CarrierIdentifier) is still called prior to android.os.Build.VERSION_CODES#TIRAMISU.

Java documentation for android.service.carrier.CarrierService.onLoadConfig(int, android.service.carrier.CarrierIdentifier).

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