Reset power mode only if screen is on

PR #1670 <https://github.com/Genymobile/scrcpy/pull/1670>

Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
brunoais 2020-08-13 07:33:36 +01:00 committed by Romain Vimont
parent 0c5e0a4f6d
commit 0bf110dd5c

View file

@ -78,7 +78,9 @@ public final class CleanUp {
if (restoreNormalPowerMode) { if (restoreNormalPowerMode) {
Ln.i("Restoring normal power mode"); Ln.i("Restoring normal power mode");
Device.setScreenPowerMode(Device.POWER_MODE_NORMAL); if (Device.isScreenOn()) {
Device.setScreenPowerMode(Device.POWER_MODE_NORMAL);
}
} }
} }
} }