diff options
| author | 2021-09-01 23:57:25 -0700 | |
|---|---|---|
| committer | 2021-09-01 23:57:25 -0700 | |
| commit | 3e0558a884e2727dca65d55c54dc88f7d9f9a8e6 (patch) | |
| tree | 1cdfd5c578619c2b706c8a66fcb50f8f0efd8697 | |
| parent | a7d0e7435928683e0c86dcd5f33acb7967886546 (diff) | |
Use Context#getPackageName when retrieving string resource identifier
Bug: 197816721
Test: Manual, confirm MDNSFilterPlugin instances init properly
Change-Id: I5ea571b3f7f557d074f4dfa6110d0dba3ffdd6e3
| -rw-r--r-- | packages/PrintRecommendationService/src/com/android/printservice/recommendation/plugin/mdnsFilter/MDNSFilterPlugin.java | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/packages/PrintRecommendationService/src/com/android/printservice/recommendation/plugin/mdnsFilter/MDNSFilterPlugin.java b/packages/PrintRecommendationService/src/com/android/printservice/recommendation/plugin/mdnsFilter/MDNSFilterPlugin.java index 5f107d662b75..34e7e3d1cd6b 100644 --- a/packages/PrintRecommendationService/src/com/android/printservice/recommendation/plugin/mdnsFilter/MDNSFilterPlugin.java +++ b/packages/PrintRecommendationService/src/com/android/printservice/recommendation/plugin/mdnsFilter/MDNSFilterPlugin.java @@ -84,8 +84,7 @@ public class MDNSFilterPlugin implements PrintServicePlugin { */ public MDNSFilterPlugin(@NonNull Context context, @NonNull String name, @NonNull CharSequence packageName, @NonNull List<String> mDNSNames) { - mName = context.getResources().getIdentifier(name, null, - "com.android.printservice.recommendation"); + mName = context.getResources().getIdentifier(name, null, context.getPackageName()); mPackageName = packageName; mMDNSFilteredDiscovery = new MDNSFilteredDiscovery(context, PRINTER_SERVICE_TYPES, new VendorNameFilter(new HashSet<>(mDNSNames))); |