Skip to content

Commit

Permalink
style(lint): ignore two discouraged api lints
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mikehardy committed Nov 15, 2024
1 parent e5ec77c commit 76371d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*
*/

import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.content.Context;
import android.graphics.Point;
Expand Down Expand Up @@ -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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -154,6 +155,7 @@ Map<String, Object> getAllValuesForApp(String appName) {
return configValuesMap;
}

@SuppressLint("DiscouragedApi")
private int getXmlResourceIdByName(String name) {
String packageName = getApplicationContext().getPackageName();
return getApplicationContext().getResources().getIdentifier(name, "xml", packageName);
Expand Down

0 comments on commit 76371d2

Please sign in to comment.