From c19c688e0cdfd2465b18c34bc024804295bf768e Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Tue, 30 Jul 2024 13:47:12 +0200 Subject: [PATCH] Do not use DisplayControl on Honor with Android 14 Some honor devices with Android 14 behave like Android 13 here. Refs #4943 --- .../src/main/java/com/genymobile/scrcpy/device/Device.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/src/main/java/com/genymobile/scrcpy/device/Device.java b/server/src/main/java/com/genymobile/scrcpy/device/Device.java index 46657a05..d87080e2 100644 --- a/server/src/main/java/com/genymobile/scrcpy/device/Device.java +++ b/server/src/main/java/com/genymobile/scrcpy/device/Device.java @@ -328,6 +328,13 @@ public final class Device { boolean useDisplayControl = Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && !SurfaceControl.hasGetPhysicalDisplayIdsMethod(); + if (useDisplayControl && Build.BRAND.equalsIgnoreCase("honor")) { + // Workaround for Honor devices with Android 14: + // - + // - + useDisplayControl = false; + } + // Change the power mode for all physical displays long[] physicalDisplayIds = useDisplayControl ? DisplayControl.getPhysicalDisplayIds() : SurfaceControl.getPhysicalDisplayIds(); if (physicalDisplayIds == null) {