I know that PowerManager and/or KeyguardManager can help me check if a device screen is locked/unlocked. Is there a way to check this via adb?
This works only when device has NFC:
# returns one of: mScreenState=OFF|ON_LOCKED|ON_UNLOCKED adb shell dumpsys nfc | grep 'mScreenState='
OFF - Screen off
ON_LOCKED - Screen displays locked screen
ON_UNLOCKED - device unlocked