4

I would like to know if it is possible to switch between different screen locks (i.e. swipe lock and pattern lock) programmatically in Android.

I am working on an application based in security contexts. Depending on contexts defined by the user, different screen locks are activated in concordance with the actual context.

As I have seen, you can change between swipe lock and disabling screen lock using:

KeyguardManager keyguardManager = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);  
lock.reenableKeyguard();        
lock.disableKeyguard();

but it would be more secure if it was possible to change between a different screen lock rather than disabling it. Is it possible to change between different screen locks?

Cœur
  • 37,241
  • 25
  • 195
  • 267
lau.tlk
  • 51
  • 2
  • I would look at device admins, I know some apps like AndroidLost can change your screen lock... I would use them as examples – Ryan S Jul 16 '13 at 00:25
  • I'll take a look. Thanks for your contribution. – lau.tlk Jul 16 '13 at 18:16
  • I just worked on something similar a few days ago. The manager which allows you to change (reset) the password only accepts a string. Based on the string it shows a different keyboard. So if the password only has numbers then it will be 0-9, otherwise it'll show Alphanumeric keyboard: http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html. Maybe there's another way to change but not that I know of. – Randy Sep 25 '13 at 04:54

0 Answers0