WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
and/or WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
instead; this allows you to seamlessly hide the keyguard as your application
moves in and out of the foreground and does not require that any special
permissions be requested.
Handle returned by KeyguardManager.newKeyguardLock(java.lang.String)
that allows
you to disable / reenable the keyguard.public class KeyguardManager.KeyguardLock extends Object
Modifier and Type | Method and Description |
---|---|
void |
disableKeyguard()
Deprecated.
Disable the keyguard from showing.
|
void |
reenableKeyguard()
Deprecated.
Reenable the keyguard.
|
public void disableKeyguard()
reenableKeyguard()
is called.
A good place to call this is from Activity.onResume()
Note: This call has no effect while any DevicePolicyManager
is enabled that requires a password.
This method requires the caller to hold the permission
android.Manifest.permission#DISABLE_KEYGUARD
.
reenableKeyguard()
public void reenableKeyguard()
disableKeyguard()
caused it to be hidden.
A good place to call this is from Activity.onPause()
Note: This call has no effect while any DevicePolicyManager
is enabled that requires a password.
This method requires the caller to hold the permission
android.Manifest.permission#DISABLE_KEYGUARD
.
disableKeyguard()