Detects if the phone screen is unlocked by a light screen

Source: Internet
Author: User

Using the ADB command to get the phone lock screen status, you can use the following instructions:
1.adb Shell Dumpsys window policy^|grep Isstatusbarkeyguard
2.adb Shell Dumpsys window policy^|grep Mshowinglockscreen

Run the 1th command to get the result, as follows:
Isstatusbarkeyguard=false mfocusedwindow=window{3c2b801 u0 Com.tencent.mm/com.tencent.mm.ui.launcherui}
Mshowinglockscreen=false Mshowingdream=false Mdreaminglockscreen=false
Run the 2nd command to get the result, as follows:
Isstatusbarkeyguard=true mfocusedwindow=window{241b4081 u0 StatusBar}
Mshowinglockscreen=true Mshowingdream=false Mdreaminglockscreen=true


Unlocked status Value:
Isstatusbarkeyguard=false
Mshowinglockscreen=false
If the above 2 instruction has a command output value NULL, then take
Isstatusbarkeyguard=false
Or
Mshowinglockscreen=false
As a judgment.

You can also enable the phone to unlock the screen according to the following actions


Light screen
ADB Shell Inputkeyevent 26
KeyEvent 26 means click Power

Unlock
ADB shell Inputswipe 500 50 500 700
Swipe slide, swipe from 500,50 to 500,700

Detects if the phone screen is unlocked by a light screen

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.