Google is committed to advancing racial equity for Black communities. See how.
Added in API level 1
Deprecated in API level 15

KeyguardLock

open class KeyguardLock
kotlin.Any
   ↳ android.app.KeyguardManager.KeyguardLock

Handle returned by KeyguardManager#newKeyguardLock that allows you to disable / reenable the keyguard.

Summary

Public methods

open Unit

Disable the keyguard from showing.

open Unit

Reenable the keyguard.

Public methods

disableKeyguard

Added in API level 1
Deprecated in API level 15
open fun disableKeyguard(): Unit

Deprecated.

Disable the keyguard from showing. If the keyguard is currently showing, hide it. The keyguard will be prevented from showing again until reenableKeyguard() is called. A good place to call this is from android.app.Activity#onResume() Note: This call has no effect while any android.app.admin.DevicePolicyManager is enabled that requires a password.
Requires android.Manifest.permission#DISABLE_KEYGUARD

reenableKeyguard

Added in API level 1
Deprecated in API level 15
open fun reenableKeyguard(): Unit

Deprecated.

Reenable the keyguard. The keyguard will reappear if the previous call to disableKeyguard() caused it to be hidden. A good place to call this is from android.app.Activity#onPause() Note: This call has no effect while any android.app.admin.DevicePolicyManager is enabled that requires a password.
Requires android.Manifest.permission#DISABLE_KEYGUARD