Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b401fa75 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Don't get application info for the system

Bug: 28107178
Change-Id: Ic1a75a7d6d6e80e0df8f3017fb8737cf18f4dd3a
parent b89d33ee
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -2459,10 +2459,12 @@ public class NotificationManagerService extends SystemService {

        // Fix the notification as best we can.
        try {
            if (!"android".equals(pkg) && !"system".equals(pkg)) {
                Notification.addFieldsFromContext(getContext().createApplicationContext(
                        getContext().getPackageManager().getApplicationInfoAsUser(
                                pkg, PackageManager.MATCH_UNINSTALLED_PACKAGES, userId),
                        Context.CONTEXT_RESTRICTED), notification);
            }
        } catch (NameNotFoundException e) {
            Slog.e(TAG, "Cannot create a context for sending app", e);
            return;