Power on the device only for main display

Power on the device on start only if scrcpy is mirroring the main
display.
This commit is contained in:
Romain Vimont 2024-10-31 20:19:58 +01:00
parent 3ac4b64461
commit f08a6d86c5

View File

@ -166,7 +166,7 @@ public class Controller implements AsyncProcessor, VirtualDisplayListener {
private void control() throws IOException {
// on start, power on the device
if (powerOn && displayId != Device.DISPLAY_ID_NONE && !Device.isScreenOn()) {
if (powerOn && displayId == 0 && !Device.isScreenOn()) {
Device.pressReleaseKeycode(KeyEvent.KEYCODE_POWER, displayId, Device.INJECT_MODE_ASYNC);
// dirty hack