1

Is there a way to find out if the user has a device lock password setup on Android OS 2.1 (i.e. as set up through Settings -> Location & security -> Change screen lock)?

My application wants to check this minimum level of security is present before providing access to some of its content.

Here's where I have got to:

  • DevicePolicyManager provides a way to set and inspect the device password policies, but that API only appears in OS 2.2.

  • I know at least some OS 2.1 devices allow you to set a device password lock (i.e. you have to enter numbers or letters instead of just using a swipe lock).

  • I've seen various forum posts saying that OS 2.1 enforces Exchange e-mail policies (is this some sort of internal only implementation of DevicePolicyManager?)

  • The closest I have found is Settings.Secure LOCK_PATTERN_ENABLED. Apparently that will only tell you if a pattern/swipe lock is set, not whether a password is set though.

I was hoping that there might be some OS 2.1 way to inspect if a password is present, rather than having to rely on a OS 2.2 API (which is rather complicated to do whilst still supporting OS 2.1 devices).

Community
  • 1
  • 1
Dan J
  • 25,433
  • 17
  • 100
  • 173

1 Answers1

0

I wouldn't force the user to set a Password for the whole device, but instead make something like a Password-Protection for your app (Like in 'Dropbox').

For this, I'd use a EditText in 'Password mode'.

Lukas Knuth
  • 25,449
  • 15
  • 83
  • 111
  • Thanks, but in my scenario we specifically want to do password protection across the whole device as: 1) It's annoying to a user to enter a device password and then an application password too, 2) My app includes a widget, which doesn't really fit the model of an in-app password, 3) This approach is consistent with many other Android apps, e.g. Facebook, e-mail etc. – Dan J Apr 28 '11 at 19:44