From 80defdd8aa29a89bc656df0f2cdc8a1474f95741 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 15 Nov 2023 12:01:10 +0100 Subject: [PATCH] Suppress private APIs lints to Workarounds class The whole class need them (including the static block). --- server/src/main/java/com/genymobile/scrcpy/Workarounds.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/Workarounds.java b/server/src/main/java/com/genymobile/scrcpy/Workarounds.java index 77827c47..db9c9629 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Workarounds.java +++ b/server/src/main/java/com/genymobile/scrcpy/Workarounds.java @@ -19,6 +19,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; +@SuppressLint("PrivateApi,BlockedPrivateApi,SoonBlockedPrivateApi,DiscouragedPrivateApi") public final class Workarounds { private static final Class ACTIVITY_THREAD_CLASS; @@ -105,7 +106,6 @@ public final class Workarounds { Looper.prepareMainLooper(); } - @SuppressLint("PrivateApi,DiscouragedPrivateApi") private static void fillAppInfo() { try { // ActivityThread.AppBindData appBindData = new ActivityThread.AppBindData(); @@ -132,7 +132,6 @@ public final class Workarounds { } } - @SuppressLint("PrivateApi,DiscouragedPrivateApi") private static void fillAppContext() { try { Application app = new Application(); @@ -162,7 +161,7 @@ public final class Workarounds { } @TargetApi(Build.VERSION_CODES.R) - @SuppressLint("WrongConstant,MissingPermission,BlockedPrivateApi,SoonBlockedPrivateApi,DiscouragedPrivateApi") + @SuppressLint("WrongConstant,MissingPermission") public static AudioRecord createAudioRecord(int source, int sampleRate, int channelConfig, int channels, int channelMask, int encoding) { // Vivo (and maybe some other third-party ROMs) modified `AudioRecord`'s constructor, requiring `Context`s from real App environment. //