Reputation: 11
I need to know how to check if any type of screen lock is enabled in the settings part of the device. I need to check this using an adb command (by using adb shell). I also need to know the type of lock applied.
I have tried dumpsys but did not get any success.
I want to know if the screen lock is enabled in the settings even if the device is currently unlocked, just check if any security is there, in any state.
Upvotes: 1
Views: 2473
Reputation: 14328
Has answered in Is there a way to check if Android device screen is locked via adb? - Stack Overflow and copy to here:
XiaoMi 9
10
mDreamingLockscreen
adb shell dumpsys window | grep mDreamingLockscreen
mShowingDream=false mDreamingLockscreen=true mDreamingSleepToken=null
-> Screen Locked
ON
or OFF
mShowingDream=false mDreamingLockscreen=false mDreamingSleepToken=null
-> Scrren Unlockednfc
(if android has NFC module)adb shell dumpsys nfc | grep 'mScreenState='
mScreenState=OFF_LOCKED
-> Screen OFF and LockedmScreenState=ON_LOCKED
-> Screen ON and LockedmScreenState=ON_UNLOCKED
-> Screen ON and UnlockedUpvotes: 2