What is the difference between isDeviceLocked and isKeyguardSecure in android KeyguardManager?

Below are excerpts from http://developer.android.com/reference/android/app/KeyguardManager.html

public boolean isDeviceLocked ()

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

public boolean isKeyguardSecure ()

Returns whether a key lock is required to unlock the password. Returns true if the keypad lock protection is protected.

What is the difference between isDeviceLocked and isKeyguardSecure ?

+6
android api locking lockscreen keyguard
May 04 '15 at 2:31
source share
1 answer

public boolean isDeviceLocked ()

This method takes into account the current state of the Lockscreen user interface.

So, if a secure screen lock has been configured, it will conflict with isKeyguardSecure () return false if:

  • User unlocked Lockscreen and uses device
  • The Smart Lock function (Settings โ†’ Security โ†’ Intelligent Lock) allows you to unlock the device without additional authentication

public boolean isKeyguardSecure ()

This method does NOT take into account the current state of the Lockscreen user interface.

So, if a secure screen lock has been set, it will always return true , regardless of whether the Lockscreen was unlocked by the user or if Smart Lock allows you to unlock it without additional authentication.

I could not reproduce the behavior described by ByteHamster. By the way

+8
May 05 '15 at 13:05
source share



All Articles