Below is excerpted 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. Returns true if unlocking the device currently requires a PIN, pattern or password.
public boolean isKeyguardSecure ()
Return whether the keyguard requires a password to unlock. Returns true if keyguard is secure.
What's the difference between isDeviceLocked
and isKeyguardSecure
?
android.app.KeyguardManager. Class that can be used to lock and unlock the keyguard. The actual class to control the keyguard locking is KeyguardManager.
Android keyguard manages the device and work challenge lock screens. This policy lets you manage features for Android Enterprise work profile keyguard and advanced device keyguard. You can control: Keyguard management on work profile devices.
public boolean isDeviceLocked ()
This method takes the current UI state of the Lockscreen into account.
So if a secure Screen Lock has been setup, it will contrary to isKeyguardSecure() return false
if:
public boolean isKeyguardSecure ()
This method does NOT take the current UI state of the Lockscreen into account.
So if a secure Screen Lock has been setup, it will always return true
, regardless of if the Lockscreen has been unlocked by the user or if Smart Lock allows unlock without further authentication.
I was not able to reproduce the behavior reported by ByteHamster btw.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With