[CDM] Checks NLS component name instead of package name

Bug: 386216637
Change-Id: I1be52fcb3d52b8b84353ea00fd57d8360ddd966c
Flag: EXEMPT bugfix
Test: CTS
This commit is contained in:
Guojing Yuan
2025-01-28 11:57:16 -08:00
parent ec58402c03
commit f5ed187ffb

View File

@@ -123,7 +123,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);
@@ -157,7 +157,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() {