From 2fff9b9edf749dd7a8ccf36fe2df3c3587f535ab Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 17 Mar 2023 22:10:38 +0100 Subject: [PATCH] Adapt FakeContext for Android 14 This fixes audio for Android 14 developer preview 2. Fixes #3784 Suggested-by: Namelesswonder --- server/src/main/java/com/genymobile/scrcpy/FakeContext.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/src/main/java/com/genymobile/scrcpy/FakeContext.java b/server/src/main/java/com/genymobile/scrcpy/FakeContext.java index 844d6bd8..738203de 100644 --- a/server/src/main/java/com/genymobile/scrcpy/FakeContext.java +++ b/server/src/main/java/com/genymobile/scrcpy/FakeContext.java @@ -38,4 +38,10 @@ public final class FakeContext extends ContextWrapper { builder.setPackageName(PACKAGE_NAME); return builder.build(); } + + // @Override to be added on SDK upgrade for Android 14 + @SuppressWarnings("unused") + public int getDeviceId() { + return 0; + } }