How to detect/identify if device Lock Screen setti

2019-06-04 01:14发布

问题:

I need to check before enabling my application if the device has no security defined on setting.

Can't have set: Pattern, PIN, Password and even Swipe.

Does anyone know a way to check if the lock screen setting is not enabled?

Alternately, can we check which of the above lock screen settings is enabled?

Thanks!

回答1:

You can use KeyguardManager - it's isSecureMethod() should return false in Your case. http://developer.android.com/reference/android/app/KeyguardManager.html