DevicePolicyManager.SetKeyguardDisabled(ComponentName, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
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.