问题
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