android - Enable or disable the PatternLock screen from code -


I have tried temporarily to find a way to disable PatternLock screens I do not completely disable lock I want to, but the user should not need to re-enter his pattern all the time.

My idea is to write a service that disables the pattern after some user activity and enables it again after a few times. (And even more)

There are apps on the market that do something (i.e. autolog or toggle pattern), so there should be a solution.

I know that I can stop using a lock completely:

  getWindow (). AddFlags (WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)  

or

  KeyguardLock.disableKeyguard ()  

but it is not That's what I am after.

I use com.android.internal.widget.LockPatternUtils which is used by the settings activity in Android sources, but this class (at least as far as I know) is a Not accessible by "normal" application.

Do you have any suggestions?

Did you try to see the code com.android.internal.widget.LockPatternUtils And what does this do?

Something like this:

  Public Zero Sitelapper enabled (Boolean enabled) {Set Boolean (android.provider.Settings.System.LOCK_PATTERN_ENABLED, enabled); } Private zero set boolean (string system setting, boolean enabled) {android.provider.Settings.System.putInt (mContentResolver, system setting, enabled? 1: 0); }  

You may be able to do something in your code.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -