Compartilhar via


DevicePolicyManager.SetConfiguredNetworksLockdownState Method

Definition

Called by a device owner or a profile owner of an organization-owned managed profile to control whether the user can change networks configured by the admin.

[Android.Runtime.Register("setConfiguredNetworksLockdownState", "(Landroid/content/ComponentName;Z)V", "GetSetConfiguredNetworksLockdownState_Landroid_content_ComponentName_ZHandler", ApiSince=30)]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_WIFI")]
public virtual void SetConfiguredNetworksLockdownState (Android.Content.ComponentName? admin, bool lockdown);
[<Android.Runtime.Register("setConfiguredNetworksLockdownState", "(Landroid/content/ComponentName;Z)V", "GetSetConfiguredNetworksLockdownState_Landroid_content_ComponentName_ZHandler", ApiSince=30)>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_WIFI")>]
abstract member SetConfiguredNetworksLockdownState : Android.Content.ComponentName * bool -> unit
override this.SetConfiguredNetworksLockdownState : Android.Content.ComponentName * bool -> unit

Parameters

admin
ComponentName

admin Which DeviceAdminReceiver this request is associated with. Null if the caller is not a device admin.

lockdown
Boolean

Whether the admin configured networks should be unmodifiable by the user.

Attributes

Remarks

Called by a device owner or a profile owner of an organization-owned managed profile to control whether the user can change networks configured by the admin. When this lockdown is enabled, the user can still configure and connect to other Wi-Fi networks, or use other Wi-Fi capabilities such as tethering.

WiFi network configuration lockdown is controlled by a global settings android.provider.Settings.Global#WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN and calling this API effectively modifies the global settings. Previously device owners can also control this directly via #setGlobalSetting but they are recommended to switch to this API.

Java documentation for android.app.admin.DevicePolicyManager.setConfiguredNetworksLockdownState(android.content.ComponentName, boolean).

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