From d7841664f4569b24823df1d153665828a3138e05 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 15 Mar 2023 19:53:40 +0100 Subject: [PATCH] Simplify logic in setScreenPowerMode() Refs Suggested-by: brunoais --- server/src/main/java/com/genymobile/scrcpy/Device.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/Device.java b/server/src/main/java/com/genymobile/scrcpy/Device.java index b66474b7..3d83f73e 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Device.java +++ b/server/src/main/java/com/genymobile/scrcpy/Device.java @@ -288,10 +288,7 @@ public final class Device { boolean allOk = true; for (long physicalDisplayId : physicalDisplayIds) { IBinder binder = SurfaceControl.getPhysicalDisplayToken(physicalDisplayId); - boolean ok = SurfaceControl.setDisplayPowerMode(binder, mode); - if (!ok) { - allOk = false; - } + allOk &= SurfaceControl.setDisplayPowerMode(binder, mode); } return allOk; }