I'm currently facing a troublesome bug with some Android Devices. I'm checking up on KeyguardManager to see if I need to disable audio or not (I want the audio be disabled whenever the game is not active or screen is locked etc.)
I've been using isDeviceLocked
method to see if the user has access or not.
But now I found a device that continuously reports that `isDeviceLocked' == true.
Android docs says
boolean isDeviceLocked ()
Returns whether the device is currently locked and requires a PIN, pattern or password to unlock.
boolean isKeyguardLocked ()
Return whether the keyguard is currently locked.
What's the difference between isDeviceLocked and isKeyguardLocked, except for that they were added in different SDK versions?
The isDeviceLocked() method returns true only when the device is locked and requires a PIN, pattern or password to unlock. The isKeyguardLocked() method is similar but it will also return true if the device is locked without any security.
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