From 2fb44ba6a54362b289524d2d920c33880adbfc75 Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Fri, 15 Nov 2024 14:09:55 -0500 Subject: [PATCH] style(lint): ignore two discouraged api lints one is never used apparently but shouldn't be removed in case brownfield apps are using it as it is public static the other is required in order to support resource load by name functionality for remote config --- .../java/io/invertase/firebase/common/SharedUtils.java | 2 ++ .../firebase/config/UniversalFirebaseConfigModule.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/app/android/src/reactnative/java/io/invertase/firebase/common/SharedUtils.java b/packages/app/android/src/reactnative/java/io/invertase/firebase/common/SharedUtils.java index c1eb8e10e5..b98134068b 100644 --- a/packages/app/android/src/reactnative/java/io/invertase/firebase/common/SharedUtils.java +++ b/packages/app/android/src/reactnative/java/io/invertase/firebase/common/SharedUtils.java @@ -17,6 +17,7 @@ * */ +import android.annotation.SuppressLint; import android.app.ActivityManager; import android.content.Context; import android.graphics.Point; @@ -181,6 +182,7 @@ public static boolean isAppInForeground(Context context) { return false; } + @SuppressLint("DiscouragedApi") public static int getResId(Context ctx, String resName) { int resourceId = ctx.getResources().getIdentifier(resName, "string", ctx.getPackageName()); diff --git a/packages/remote-config/android/src/main/java/io/invertase/firebase/config/UniversalFirebaseConfigModule.java b/packages/remote-config/android/src/main/java/io/invertase/firebase/config/UniversalFirebaseConfigModule.java index cfcc443508..5dc3d4c1ca 100644 --- a/packages/remote-config/android/src/main/java/io/invertase/firebase/config/UniversalFirebaseConfigModule.java +++ b/packages/remote-config/android/src/main/java/io/invertase/firebase/config/UniversalFirebaseConfigModule.java @@ -19,6 +19,7 @@ import static com.google.firebase.remoteconfig.FirebaseRemoteConfig.*; +import android.annotation.SuppressLint; import android.content.Context; import android.content.res.Resources; import android.content.res.XmlResourceParser; @@ -154,6 +155,7 @@ Map getAllValuesForApp(String appName) { return configValuesMap; } + @SuppressLint("DiscouragedApi") private int getXmlResourceIdByName(String name) { String packageName = getApplicationContext().getPackageName(); return getApplicationContext().getResources().getIdentifier(name, "xml", packageName);