码迷,mamicode.com
首页 > 其他好文 > 详细

判断屏幕的状态后,怎么处理?

时间:2018-08-17 19:06:35      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:color   nbsp   open   ref   hand   lan   adb shell   学习   直接   

## 判断锁屏状态 adb shell dumpsys window policy | findstr isStatusBarKeyguard
## 判断亮灭屏状态 adb shell dumpsys window policy | findstr ScreenOn
def handling_screen_status():
    "检查屏幕状态,并作出处理"
    order = adb shell dumpsys window policy | findstr isStatusBarKeyguard #可以直接指定APP吗?
    pi = subprocess.Popen(order, shell=True)
    # print(str(pi))
    if "isStatusBarKeyguard=true" in str(pi):   #状态值不能接收,怎么实现?
        powerkey()

 

这里学习下:

https://blog.csdn.net/u013948858/article/details/80424430

判断屏幕的状态后,怎么处理?

标签:color   nbsp   open   ref   hand   lan   adb shell   学习   直接   

原文地址:https://www.cnblogs.com/testerhome-yizhou2018/p/9494785.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!