# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Nested Classes | Methods | Inherited Methods

# KeyguardManager

`public class KeyguardManager`
`extends Object` ``

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

Class that can be used to lock and unlock the keyguard. The actual class to control the keyguard locking is `KeyguardManager.KeyguardLock`.

## Summary

### Nested classes
`class` | `KeyguardManager.KeyguardDismissCallback` Callback passed to `KeyguardManager#requestDismissKeyguard(Activity, KeyguardDismissCallback)` to notify caller of result.
`class` | `KeyguardManager.KeyguardLock` This class is deprecated. Use `LayoutParams#FLAG_DISMISS_KEYGUARD` and/or `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.
`interface` | `KeyguardManager.OnKeyguardExitResult` This interface is deprecated. Use `KeyguardDismissCallback`

### Public methods
`Intent` | `createConfirmDeviceCredentialIntent(CharSequence title, CharSequence description)` This method is deprecated. see BiometricPrompt.Builder#setDeviceCredentialAllowed(boolean)
`void` | `exitKeyguardSecurely(KeyguardManager.OnKeyguardExitResult callback)` This method is deprecated. Use `LayoutParams#FLAG_DISMISS_KEYGUARD` and/or `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.
`boolean` | `inKeyguardRestrictedInputMode()` This method is deprecated. Use `isKeyguardLocked()` instead.
`boolean` | `isDeviceLocked()` Returns whether the device is currently locked and requires a PIN, pattern or password to unlock.
`boolean` | `isDeviceSecure()` Returns whether the device is secured with a PIN, pattern or password.
`boolean` | `isKeyguardLocked()` Return whether the keyguard is currently locked.
`boolean` | `isKeyguardSecure()` Return whether the keyguard is secured by a PIN, pattern or password or a SIM card is currently locked.
`KeyguardManager.KeyguardLock` | `newKeyguardLock(String tag)` This method is deprecated. Use `LayoutParams#FLAG_DISMISS_KEYGUARD` and/or `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.
`void` | `requestDismissKeyguard(Activity activity, KeyguardManager.KeyguardDismissCallback callback)` If the device is currently locked (see `isKeyguardLocked()`, requests the Keyguard to be dismissed.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public methods

### createConfirmDeviceCredentialIntent

    public Intent createConfirmDeviceCredentialIntent (CharSequence title,
                    CharSequence description)

This method is deprecated.
see BiometricPrompt.Builder#setDeviceCredentialAllowed(boolean)

Get an intent to prompt the user to confirm credentials (pin, pattern, password or biometrics if enrolled) for the current user of the device. The caller is expected to launch this activity using `Activity.startActivityForResult(Intent, int)` and check for `Activity.RESULT_OK` if the user successfully completes the challenge.
Requires the `PackageManager#FEATURE_SECURE_LOCK_SCREEN` feature which can be detected using `PackageManager.hasSystemFeature(String)`.

Parameters
`title` | `CharSequence`
`description` | `CharSequence`

Returns
`Intent` | the intent for launching the activity or null if no password is required.

### exitKeyguardSecurely

    public void exitKeyguardSecurely (KeyguardManager.OnKeyguardExitResult callback)

This method is deprecated.
Use `LayoutParams#FLAG_DISMISS_KEYGUARD` and/or `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.

Exit the keyguard securely. The use case for this api is that, after disabling the keyguard, your app, which was granted permission to disable the keyguard and show a limited amount of information deemed safe without the user getting past the keyguard, needs to navigate to something that is not safe to view without getting past the keyguard. This will, if the keyguard is secure, bring up the unlock screen of the keyguard.
Requires `Manifest.permission.DISABLE_KEYGUARD`

Parameters
`callback` | `KeyguardManager.OnKeyguardExitResult`: Lets you know whether the operation was successful and it is safe to launch anything that would normally be considered safe once the user has gotten past the keyguard.

### inKeyguardRestrictedInputMode

    public boolean inKeyguardRestrictedInputMode ()

This method is deprecated.
Use `isKeyguardLocked()` instead.

If keyguard screen is showing or in restricted key input mode (i.e. in keyguard password emergency screen). When in such mode, certain keys, such as the Home key and the right soft keys, don't work.

Returns
`boolean` | true if in keyguard restricted input mode.

### isDeviceLocked

    public boolean isDeviceLocked ()

Returns whether the device is currently locked and requires a PIN, pattern or password to unlock.

Returns
`boolean` | true if unlocking the device currently requires a PIN, pattern or password.

### isDeviceSecure

    public boolean isDeviceSecure ()

Returns whether the device is secured with a PIN, pattern or password.

See also `isKeyguardSecure()` which treats SIM locked states as secure.

Returns
`boolean` | true if a PIN, pattern or password was set.

### isKeyguardLocked

    public boolean isKeyguardLocked ()

Return whether the keyguard is currently locked.

Returns
`boolean` | true if keyguard is locked.

### isKeyguardSecure

    public boolean isKeyguardSecure ()

Return whether the keyguard is secured by a PIN, pattern or password or a SIM card is currently locked.

See also `isDeviceSecure()` which ignores SIM locked states.

Returns
`boolean` | true if a PIN, pattern or password is set or a SIM card is locked.

### newKeyguardLock

    public KeyguardManager.KeyguardLock newKeyguardLock (String tag)

This method is deprecated.
Use `LayoutParams#FLAG_DISMISS_KEYGUARD` and/or `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.

Enables you to lock or unlock the keyguard. Get an instance of this class by calling `Context.getSystemService()`. This class is wrapped by `KeyguardManager`.

Parameters
`tag` | `String`: A tag that informally identifies who you are (for debugging who is disabling the keyguard).

Returns
`KeyguardManager.KeyguardLock` | A `KeyguardLock` handle to use to disable and reenable the keyguard.

### requestDismissKeyguard

    public void requestDismissKeyguard (Activity activity,
                    KeyguardManager.KeyguardDismissCallback callback)

If the device is currently locked (see `isKeyguardLocked()`, requests the Keyguard to be dismissed.

If the Keyguard is not secure or the device is currently in a trusted state, calling this method will immediately dismiss the Keyguard without any user interaction.

If the Keyguard is secure and the device is not in a trusted state, this will bring up the UI so the user can enter their credentials.

If the value set for the `Activity` attr `R.attr.turnScreenOn` is true, the screen will turn on when the keyguard is dismissed.

Parameters
`activity` | `Activity`: The activity requesting the dismissal. The activity must be either visible by using `LayoutParams#FLAG_SHOW_WHEN_LOCKED` or must be in a state in which it would be visible if Keyguard would not be hiding it. If that's not the case, the request will fail immediately and `KeyguardDismissCallback#onDismissError` will be invoked. This value cannot be `null`.
`callback` | `KeyguardManager.KeyguardDismissCallback`: The callback to be called if the request to dismiss Keyguard was successful or `null` if the caller isn't interested in knowing the result. The callback will not be invoked if the activity was destroyed before the callback was received. This value may be `null`.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*