For api < 16: How to detect if PIN/password/pattern is required to unlock phone?

旧街凉风 提交于 2019-12-08 07:12:36

问题


I already know these two cases:

1) for devices using api >= 16, one could just use the method isDeviceSecure() from KeyguardManager and that would return true if any locking mechanism is used on the device (pattern, passcode, password, etc.)

2) for devices using api <= 15, one could do something like if (Settings.Secure.getInt(getContentResolver(), Settings.Secure.LOCK_PATTERN_ENABLED) == 0), but that would only check for screen locking pattern (not passcode, password, etc.)

So my question is how would I check for any screen locking mechanism on devices using api <= 15?

来源:https://stackoverflow.com/questions/42394996/for-api-16-how-to-detect-if-pin-password-pattern-is-required-to-unlock-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!