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

Commit 406895cd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Refrain from overwriting shortcut icon with default icon" into ub-launcher3-master

parents 1aee9da5 61e8ae1d
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -67,8 +67,8 @@ public class IconCache extends BaseIconCache {

    private static final String TAG = "Launcher.IconCache";

    private final Predicate<ItemInfoWithIcon> mIsUsingFallbackIconCheck = w -> w.bitmap != null
            && w.bitmap.isNullOrLowRes() && !isDefaultIcon(w.bitmap, w.user);
    private final Predicate<ItemInfoWithIcon> mIsUsingFallbackOrNonDefaultIconCheck = w ->
            w.bitmap != null && (w.bitmap.isNullOrLowRes() || !isDefaultIcon(w.bitmap, w.user));

    private final CachingLogic<ComponentWithLabel> mComponentWithLabelCachingLogic;
    private final CachingLogic<LauncherActivityInfo> mLauncherActivityInfoCachingLogic;
@@ -192,14 +192,14 @@ public class IconCache extends BaseIconCache {
     * Fill in {@param info} with the icon for {@param si}
     */
    public void getShortcutIcon(ItemInfoWithIcon info, ShortcutInfo si) {
        getShortcutIcon(info, si, true, mIsUsingFallbackIconCheck);
        getShortcutIcon(info, si, true, mIsUsingFallbackOrNonDefaultIconCheck);
    }

    /**
     * Fill in {@param info} with an unbadged icon for {@param si}
     */
    public void getUnbadgedShortcutIcon(ItemInfoWithIcon info, ShortcutInfo si) {
        getShortcutIcon(info, si, false, mIsUsingFallbackIconCheck);
        getShortcutIcon(info, si, false, mIsUsingFallbackOrNonDefaultIconCheck);
    }

    /**