Merge "[CDM] Checks NLS component name instead of package name" into tm-dev

This commit is contained in:
Guojing Yuan
2025-03-12 11:22:03 -07:00
committed by Android (Google) Code Review

View File

@@ -122,7 +122,7 @@ public class NotificationAccessConfirmationActivity extends Activity
NLSIntent, /* flags */ 0, mUserId); NLSIntent, /* flags */ 0, mUserId);
boolean hasNLSIntentFilter = false; boolean hasNLSIntentFilter = false;
for (ResolveInfo service : matchedServiceList) { for (ResolveInfo service : matchedServiceList) {
if (service.serviceInfo.packageName.equals(mComponentName.getPackageName())) { if (service.serviceInfo.getComponentName().equals(mComponentName)) {
if (!requiredPermission.equals(service.serviceInfo.permission)) { if (!requiredPermission.equals(service.serviceInfo.permission)) {
Slog.e(LOG_TAG, "Service " + mComponentName + " lacks permission " Slog.e(LOG_TAG, "Service " + mComponentName + " lacks permission "
+ requiredPermission); + requiredPermission);
@@ -156,7 +156,7 @@ public class NotificationAccessConfirmationActivity extends Activity
.installContent(p); .installContent(p);
// Consistent with the permission dialog // Consistent with the permission dialog
// Used instead of p.mCancelable as that is only honored for AlertDialog // Used instead of p.mCancelable as that is only honored for AlertDialog
getWindow().setCloseOnTouchOutside(false); getWindow().setCloseOnTouchOutside(false);
} }
private void onAllow() { private void onAllow() {