Added in API level 1
Deprecated in API level 15

KeyguardManager.KeyguardLock


public class KeyguardManager.KeyguardLock
extends Object

java.lang.Object
   ↳ android.app.KeyguardManager.KeyguardLock


This class was deprecated in API level 15.
Use R.attr.showWhenLocked or Activity.setShowWhenLocked(boolean) instead. This allows you to seamlessly occlude and unocclude 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 that allows you to temporarily disable / reenable the keyguard (lock screen).

Summary

Public methods

void disableKeyguard()

Disable the keyguard from showing.

void reenableKeyguard()

Reenable the keyguard.

Inherited methods

Public methods

disableKeyguard

Added in API level 1
public void disableKeyguard ()

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.

This only works if the keyguard is not secure.

A good place to call this is from Activity.onResume()
Requires Manifest.permission.DISABLE_KEYGUARD

reenableKeyguard

Added in API level 1
public void reenableKeyguard ()

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 Activity.onPause()
Requires Manifest.permission.DISABLE_KEYGUARD

See also: