mirror of
https://github.com/Genymobile/scrcpy
synced 2024-12-24 08:02:45 +00:00
Use non-secure display for Android 12 preview
Android 12 preview identifies as Android 11, but its codename is "S". Refs #2129 <https://github.com/Genymobile/scrcpy/issues/2129>
This commit is contained in:
parent
f7533e8896
commit
16a63e0917
@ -226,8 +226,10 @@ public class ScreenEncoder implements Device.RotationListener {
|
||||
}
|
||||
|
||||
private static IBinder createDisplay() {
|
||||
// Since Android 12, secure displays could not be created with shell permissions anymore
|
||||
boolean secure = Build.VERSION.SDK_INT <= Build.VERSION_CODES.R;
|
||||
// Since Android 12 (preview), secure displays could not be created with shell permissions anymore.
|
||||
// On Android 12 preview, SDK_INT is still R (not S), but CODENAME is "S".
|
||||
boolean secure = Build.VERSION.SDK_INT < Build.VERSION_CODES.R || (Build.VERSION.SDK_INT == Build.VERSION_CODES.R && !"S"
|
||||
.equals(Build.VERSION.CODENAME));
|
||||
return SurfaceControl.createDisplay("scrcpy", secure);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user