Freigeben über


DevicePolicyManager.SetKeyguardDisabled(ComponentName, Boolean) Method

Definition

Called by a device owner or profile owner of secondary users that is affiliated with the device to disable the keyguard altogether.

[Android.Runtime.Register("setKeyguardDisabled", "(Landroid/content/ComponentName;Z)Z", "GetSetKeyguardDisabled_Landroid_content_ComponentName_ZHandler", ApiSince=23)]
public virtual bool SetKeyguardDisabled (Android.Content.ComponentName admin, bool disabled);
[<Android.Runtime.Register("setKeyguardDisabled", "(Landroid/content/ComponentName;Z)Z", "GetSetKeyguardDisabled_Landroid_content_ComponentName_ZHandler", ApiSince=23)>]
abstract member SetKeyguardDisabled : Android.Content.ComponentName * bool -> bool
override this.SetKeyguardDisabled : Android.Content.ComponentName * bool -> bool

Parameters

admin
ComponentName

Which DeviceAdminReceiver this request is associated with.

disabled
Boolean

true disables the keyguard, false reenables it.

Returns

false if attempting to disable the keyguard while a lock password was in place. true otherwise.

Attributes

Remarks

Called by a device owner or profile owner of secondary users that is affiliated with the device to disable the keyguard altogether.

Setting the keyguard to disabled has the same effect as choosing "None" as the screen lock type. However, this call has no effect if a password, pin or pattern is currently set. If a password, pin or pattern is set after the keyguard was disabled, the keyguard stops being disabled.

As of android.os.Build.VERSION_CODES#P, this call also dismisses the keyguard if it is currently shown.

Java documentation for android.app.admin.DevicePolicyManager.setKeyguardDisabled(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