How we can get the Lock Screen settings status?

bsnqt

Active Member
Licensed User
Longtime User
Dear Erel (and All),

I would like to know the user's settings in Settings > Screen Lock (what kind of Screen Lock user is using).

They have several types of Screen Lock:
- Non
- Slide
- Face Unlock
- Pattern
- PIN
- Password

(at least I see those seetings in my device Sony LT26i)

I have a look in Device Administration Library as well as some information in developer.android.com but cannot find it out. Is there any method that gives us such kind of information.

Thank you very much.
 

bsnqt

Active Member
Licensed User
Longtime User
I could find only a half answer.
By using the codes below we can find if the lock type is requiring password or not. So if it returns false the user is using lock type 1 & 2 (Non & Slide), if it returns true then user is using password lock types (3, 4, 5 and 6). But it seems difficult to find which exact type the user is using...

1- Non
2- Slide
3- Face Unlock
4- Pattern
5- PIN
6- Password

B4X:
Sub CheckLockType As Boolean
   Dim r As Reflector
   r.Target = r.GetContext
   r.Target = r.RunMethod2("getSystemService", "keyguard", "java.lang.String")
   Return  r.RunMethod("isKeyguardSecure")
End Sub

Any further idea, please and please.

Thank you.
 
Last edited:
Upvote 0

NeoTechni

Well-Known Member
Licensed User
Longtime User
I dont think we can get that, as it would be dependent on your ROM.
The best you could do is check if the device is locked/unlocked, and add options for the user to tell you more
 
Upvote 0

bsnqt

Active Member
Licensed User
Longtime User
I dont think we can get that, as it would be dependent on your ROM.
The best you could do is check if the device is locked/unlocked, and add options for the user to tell you more

Ok noted, thanks for your idea. Yes if I cannot find a solution then adding options to the users will be the final way :)

Best regards,

bsnqt
 
Upvote 0
Top