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

Commit 97aec978 authored by Adam Bookatz's avatar Adam Bookatz Committed by android-build-merger
Browse files

Merge "loadUnbadgedItemIcon doesn't crash from getUserIcon" into qt-dev am:...

Merge "loadUnbadgedItemIcon doesn't crash from getUserIcon" into qt-dev am: 14a34b9e am: aaa16c07
am: 5429fd5e

Change-Id: I345a035d702d699777f5a651664a8a9801ee68b8
parents 4f90359e 5429fd5e
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -2787,12 +2787,11 @@ public class ApplicationPackageManager extends PackageManager {
    public Drawable loadUnbadgedItemIcon(@NonNull PackageItemInfo itemInfo,
            @Nullable ApplicationInfo appInfo) {
        if (itemInfo.showUserIcon != UserHandle.USER_NULL) {
            Bitmap bitmap = getUserManager().getUserIcon(itemInfo.showUserIcon);
            if (bitmap == null) {
            // Indicates itemInfo is for a different user (e.g. a profile's parent), so use a 
            // generic user icon (users generally lack permission to view each other's actual icons)
            int targetUserId = itemInfo.showUserIcon;
            return UserIcons.getDefaultUserIcon(
                        mContext.getResources(), itemInfo.showUserIcon, /* light= */ false);
            }
            return new BitmapDrawable(bitmap);
                    mContext.getResources(), targetUserId, /* light= */ false);
        }
        Drawable dr = null;
        if (itemInfo.packageName != null) {
+1 −1
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ public class PackageItemInfo {
    public Bundle metaData;

    /**
     * If different of UserHandle.USER_NULL, The icon of this item will be the one of that user.
     * If different of UserHandle.USER_NULL, The icon of this item will represent that user.
     * @hide
     */
    public int showUserIcon;