Simplify logic in setScreenPowerMode()

Refs <https://github.com/Genymobile/scrcpy/commit/f2dee20a207b9906574d9b3d62a0ab2585dade20#r104417398>

Suggested-by: brunoais <brunoaiss@gmail.com>
This commit is contained in:
Romain Vimont
2023-03-15 19:53:58 +01:00
parent 39544f34b4
commit d7841664f4
@@ -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;
}