Freigeben über


DevicePolicyManager.UpdateOverrideApn Method

Definition

Called by device owner or managed profile owner to update an override APN.

[Android.Runtime.Register("updateOverrideApn", "(Landroid/content/ComponentName;ILandroid/telephony/data/ApnSetting;)Z", "GetUpdateOverrideApn_Landroid_content_ComponentName_ILandroid_telephony_data_ApnSetting_Handler", ApiSince=28)]
public virtual bool UpdateOverrideApn (Android.Content.ComponentName admin, int apnId, Android.Telephony.Data.ApnSetting apnSetting);
[<Android.Runtime.Register("updateOverrideApn", "(Landroid/content/ComponentName;ILandroid/telephony/data/ApnSetting;)Z", "GetUpdateOverrideApn_Landroid_content_ComponentName_ILandroid_telephony_data_ApnSetting_Handler", ApiSince=28)>]
abstract member UpdateOverrideApn : Android.Content.ComponentName * int * Android.Telephony.Data.ApnSetting -> bool
override this.UpdateOverrideApn : Android.Content.ComponentName * int * Android.Telephony.Data.ApnSetting -> bool

Parameters

admin
ComponentName

which DeviceAdminReceiver this request is associated with

apnId
Int32

the id of the override APN to update

apnSetting
ApnSetting

the override APN to update

Returns

true if the required override APN is successfully updated, false otherwise.

Attributes

Remarks

Called by device owner or managed profile owner to update an override APN.

This method may returns false if there is no override APN with the given apnId.

This method may also returns false if apnSetting conflicts with an existing override APN. Update the existing conflicted APN instead.

See #addOverrideApn for the definition of conflict.

Before Android version android.os.Build.VERSION_CODES#TIRAMISU: Only device owners can update APNs.

Starting from Android version android.os.Build.VERSION_CODES#TIRAMISU: Both device owners and managed profile owners can update enterprise APNs (ApnSetting#TYPE_ENTERPRISE), while only device owners can update other type of APNs.

Java documentation for android.app.admin.DevicePolicyManager.updateOverrideApn(android.content.ComponentName, int, android.telephony.data.ApnSetting).

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