How do I access the password type settings of an Android device?
I'm trying to access my devices password type settings and am getting a
SettingNotFoundException even though the device does have a lock PIN set.
I have tried using the LockPatternUtils suggested in this question here
but it does not work.
Here is basically what I'm doing (and what LockPatternUtils does):
try {
result = android.provider.Settings.Secure.getLong(
mContentResolver, "lockscreen.password_type");
} catch (SettingNotFoundException e) {
Log.d("Cannot get key", "cannot get long value", e);
}
This is where the SettingNotFoundException occurs since it obviously
cannot find that setting.
Here is the kicker. I'm testing this on 2 different devices. One has a
password of 6 characters and the other has a PIN of 4 characters. The
first has Android 4.1.2 and the other 4.2.1. It works fine on the first
one that's running on 4.1.2
Thank you!
No comments:
Post a Comment