Page 1 of 1

Display OFF via SurfaceControl

Posted: 14 Aug 2019 01:44
by Bluscre
There is a display ON action but none for turning the display off

https://android.googlesource.com/platfo ... ol.java#82

Code: Select all

SurfaceControl.setDisplayPowerMode(SurfaceControl.POWER_MODE_OFF)

Re: Display OFF via SurfaceControl

Posted: 15 Aug 2019 19:13
by Martin
Unfortunately this method is not white listed by Google so it can not even be called with reflection in an action Script.
Best option is to use either action Lock Device, Control UI: lockScreen() or on a rooted device simulate a press of the power button in Execute Root Command: input keyevent 26.

Regards,
Martin