[CDM] Checks NLS component name instead of package name

Bug: 386216637
Flag: EXEMPT bugfix
Test: CTS

Change-Id: I1be52fcb3d52b8b84353ea00fd57d8360ddd966c
Merged-In: I1be52fcb3d52b8b84353ea00fd57d8360ddd966c
(cherry picked from commit f5ed187ffb)
This commit is contained in:
Guojing Yuan
2025-01-28 11:57:16 -08:00
parent 98fc4f2356
commit b0fce927bf

View File

@@ -122,7 +122,7 @@ public class NotificationAccessConfirmationActivity extends Activity
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);
@@ -156,7 +156,7 @@ public class NotificationAccessConfirmationActivity extends Activity
.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() {