[CDM] Checks NLS component name instead of package name

Bug: 386216637
Flag: EXEMPT bugfix
Test: CTS
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f5ed187ffb6f5a25ac1c06a1e8b023b0c7d8d4b8)
Merged-In: I1be52fcb3d52b8b84353ea00fd57d8360ddd966c
Change-Id: I1be52fcb3d52b8b84353ea00fd57d8360ddd966c
diff --git a/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java b/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java
index 8448a8e..541c105 100644
--- a/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java
+++ b/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java
@@ -123,7 +123,7 @@
                 NLSIntent, /* flags */ 0, mUserId);
         boolean hasNLSIntentFilter = false;
         for (ResolveInfo service : matchedServiceList) {
-            if (service.serviceInfo.packageName.equals(mComponentName.getPackageName())) {
+            if (service.serviceInfo.getComponentName().equals(mComponentName)) {
                 if (!requiredPermission.equals(service.serviceInfo.permission)) {
                     Slog.e(LOG_TAG, "Service " + mComponentName + " lacks permission "
                             + requiredPermission);
@@ -157,7 +157,7 @@
                 .installContent(p);
         // Consistent with the permission dialog
         // Used instead of p.mCancelable as that is only honored for AlertDialog
-        getWindow().setCloseOnTouchOutside(false); 
+        getWindow().setCloseOnTouchOutside(false);
     }
 
     private void onAllow() {