Friday, October 26, 2012

[android-developers] Test if screenlock is enabled

I need to check if this app has security (screenlocks), enabled. I have found out how to check for pattern_locks like this  

    boolean b = android.provider.Settings.Secure.getInt(
                    getContentResolver(),Settings.Secure.LOCK_PATTERN_ENABLED, 0)==1;

But the other two evades me. I have found a bit about password using the DevicePolicyManager which requires a broadcast receiver and enormous amount of permissions/policies...   
But this is imho. far overreaching of what is needed since I don't need what kind of password or a like is enabled, but simply if a screenlocking method is being used by the phone(user).

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate