From ca3d807e7fe2cd795d0efe74034640d1594a1954 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 19 Feb 2021 17:11:44 +0100 Subject: [PATCH] Use non-secure display for Android >= 12 Since Android 12, secure displays could not be created with shell permissions anymore. Refs commit 1fdde490fd2a0b89680a2b5da5e5274192398023 Fixes #2129 --- .../src/main/java/com/genymobile/scrcpy/ScreenEncoder.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java index c7c104e4f5..9a149241eb 100644 --- a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java +++ b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java @@ -7,6 +7,7 @@ import android.media.MediaCodecInfo; import android.media.MediaCodecList; import android.media.MediaFormat; +import android.os.Build; import android.os.IBinder; import android.view.Surface; @@ -225,7 +226,9 @@ private static MediaFormat createFormat(int bitRate, int maxFps, List