I need to check if there is a lockscreen Pin or something more secure (password, fingerprint, etc.). I can check if there is a Pin, Password or pattern.
KeyguardManager keyguardManager = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);
return keyguardManager.isKeyguardSecure();
My problem is that I cannot determine if the lockscreen is a template or something below. I tried this:
int lockPatternEnable = Settings.Secure.getInt(cr, Settings.Secure.LOCK_PATTERN_ENABLED);
but it is outdated and gives me an error. I also tried this:
long mode2 = Settings.Secure.getLong(contentResolver, "lockscreen.password_type");
but it also means SecurityException.
Is there a way to determine if the lock screen has a pin (or higher), or does it have a lock pattern or something lower? KeyguardManager is not useful to me this way: /
Any help is appreciated! Thank!
/ change
Error for the first:
Caused by: java.lang.SecurityException: Settings.Secure.lock_pattern_autolock is deprecated and no longer accessible. See API documentation for potential replacements.
Exception for the second: W / System.err: android.provider.Settings $ SettingNotFoundException: lockscreen.password_type
, Marshmallow (https://developer.android.com/reference/android/provider/Settings.Secure.html)