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

Commit a71e3903 authored by Alexandra Gherghina's avatar Alexandra Gherghina
Browse files

Return a default icon from the package manager directly

Bug: 16369104
Change-Id: I2db300a69a08030eacc245ee91556f0443ba5878
parent 1c7a170f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1623,11 +1623,11 @@ final class ApplicationPackageManager extends PackageManager {
            return new BitmapDrawable(getUserManager().getUserIcon(itemInfo.showUserIcon));
        }
        Drawable dr = getDrawable(itemInfo.packageName, itemInfo.icon, appInfo);
        if (dr != null) {
            dr = getUserManager().getBadgedDrawableForUser(dr,
                    new UserHandle(mContext.getUserId()));
        if (dr == null) {
            dr = getDefaultActivityIcon();
        }
        return dr;
        return getUserManager().getBadgedDrawableForUser(dr,
                new UserHandle(mContext.getUserId()));
    }

    private static class LegacyPackageInstallObserver extends PackageInstallObserver {
+2 −8
Original line number Diff line number Diff line
@@ -152,13 +152,7 @@ public class PackageItemInfo {
     * such as the default activity icon.
     */
    public Drawable loadIcon(PackageManager pm) {
        if (icon != 0 || showUserIcon != UserHandle.USER_NULL) {
            Drawable dr = pm.loadItemIcon(this, getApplicationInfo());
            if (dr != null) {
                return dr;
            }
        }
        return loadDefaultIcon(pm);
        return pm.loadItemIcon(this, getApplicationInfo());
    }

    /**