Reputation: 57
Is there a way to detect how actually user unlock phone? - via PIN or pattern or using swipe gesture I've googled only smth about registering Receiver
with this code in onReceive()
KeyguardManager keyguardManager =
(KeyguardManager)context.getSystemService(Context.KEYGUARD_SERVICE);
if (keyguardManager.isKeyguardSecure())
Upvotes: 0
Views: 279
Reputation: 2916
Since the Settings.Secure.getLong method is deprecated since API level 23, and that it has been replaced by the KeyGuardManager, it doesn't seem possible to retrieve the exact lock type.
As you've found out, using isDeviceSecure() is the closest information you can retrieve.
Upvotes: 2