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

Commit 1aca0dd7 authored by Kenny Guy's avatar Kenny Guy
Browse files

Load ApplicationInfo for correct user.

Use package manager for the user that the
notification is built for so it can load
ApplicationInfos for packages installed
in secondard uses but not primary user.

Bug: 17313228
Change-Id: I1b9fa031676e3ba77047c88ae2c2b37a2a38dbb2
parent d757d6bf
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -581,9 +581,11 @@ public abstract class BaseStatusBar extends SystemUI implements

    protected void applyColorsAndBackgrounds(StatusBarNotification sbn,
            NotificationData.Entry entry) {
        PackageManager pmUser = getPackageManagerForUser(
                entry.notification.getUser().getIdentifier());
        int version = 0;
        try {
            ApplicationInfo info = mContext.getPackageManager().getApplicationInfo(sbn.getPackageName(), 0);
            ApplicationInfo info = pmUser.getApplicationInfo(sbn.getPackageName(), 0);
            version = info.targetSdkVersion;
        } catch (NameNotFoundException ex) {
            Log.e(TAG, "Failed looking up ApplicationInfo for " + sbn.getPackageName(), ex);