From 0bf110dd5cc6a9793177c7764fe7fbfb452628f6 Mon Sep 17 00:00:00 2001 From: brunoais Date: Thu, 13 Aug 2020 07:33:36 +0100 Subject: [PATCH] Reset power mode only if screen is on PR #1670 Signed-off-by: Romain Vimont --- server/src/main/java/com/genymobile/scrcpy/CleanUp.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/CleanUp.java b/server/src/main/java/com/genymobile/scrcpy/CleanUp.java index d0ea141b..efaa059a 100644 --- a/server/src/main/java/com/genymobile/scrcpy/CleanUp.java +++ b/server/src/main/java/com/genymobile/scrcpy/CleanUp.java @@ -78,7 +78,9 @@ public final class CleanUp { if (restoreNormalPowerMode) { Ln.i("Restoring normal power mode"); - Device.setScreenPowerMode(Device.POWER_MODE_NORMAL); + if (Device.isScreenOn()) { + Device.setScreenPowerMode(Device.POWER_MODE_NORMAL); + } } } }