Is there a way to check if Android device screen is locked via adb? -


i know powermanager and/or keyguardmanager can me check if device screen locked/unlocked. there way check via adb?

this command output relating power device:

adb shell dumpsys power 

you can pipe grep values of mholdingwakelocksuspendblocker , mholdingdisplaysuspendblocker:

adb shell dumpsys power | grep 'mholding' 

if both false, display off.

if mholdingwakelocksuspendblocker false, , mholdingdisplaysuspendblocker true, display on, locked.

if both true, display on.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -