DevicePolicyManager.RemoveOverrideApn(ComponentName, Int32) Method

Definition

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

[Android.Runtime.Register("removeOverrideApn", "(Landroid/content/ComponentName;I)Z", "GetRemoveOverrideApn_Landroid_content_ComponentName_IHandler", ApiSince=28)]
public virtual bool RemoveOverrideApn (Android.Content.ComponentName admin, int apnId);
[<Android.Runtime.Register("removeOverrideApn", "(Landroid/content/ComponentName;I)Z", "GetRemoveOverrideApn_Landroid_content_ComponentName_IHandler", ApiSince=28)>]
abstract member RemoveOverrideApn : Android.Content.ComponentName * int -> bool
override this.RemoveOverrideApn : Android.Content.ComponentName * int -> bool

Parameters

admin
ComponentName

which DeviceAdminReceiver this request is associated with

apnId
Int32

the id of the override APN to remove

Returns

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

Attributes

Remarks

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

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

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

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

Java documentation for android.app.admin.DevicePolicyManager.removeOverrideApn(android.content.ComponentName, 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