dtmilano / AndroidViewClient

Android ViewServer and ADB client
Apache License 2.0
1.62k stars 345 forks source link

Android10 compatibility - isScreenOn #279

Closed rook828 closed 4 years ago

rook828 commented 4 years ago

In adbclient.py, isScreenOn() checks for mScreenFullyOn, which was removed in API 29. Following [documentation for PowerManager](https://developer.android.com/reference/android/os/PowerManager#isScreenOn()), I added a check for interactiveState prior to the RuntimeError to enable execution on Android 10 devices.

Another option I explored was using screenState, but the documentation seems to indicate that interactiveState should be used.