mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 09:26:51 +00:00
Various icon cache fixes
> Multiple instances of LauncherIcon created when
LauncherIcons refers IconCache which in turn creates new LauncherIcons
> Widget icons are never cached as they were using low res icons
> Shortcut drag icons are not loaded synchronously
when using PinItemRequest flow
> Wrong lastUpdatedTime is used in iconCache for shortcuts
> IconUpdateHandler does not ignore managedUser promise icons
Change-Id: Ie7eed68a30fad11d1861b6c70c380953a15ae1cf
This commit is contained in:
@@ -23,7 +23,6 @@ import com.android.launcher3.ItemInfo;
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
import com.android.launcher3.LauncherSettings;
|
||||
import com.android.launcher3.WorkspaceItemInfo;
|
||||
import com.android.launcher3.icons.LauncherIcons;
|
||||
import com.android.launcher3.shortcuts.ShortcutKey;
|
||||
import com.android.launcher3.shortcuts.ShortcutRequest;
|
||||
import com.android.launcher3.util.ItemInfoMatcher;
|
||||
@@ -89,12 +88,7 @@ public class ShortcutsChangedTask extends BaseModelUpdateTask {
|
||||
}
|
||||
for (final WorkspaceItemInfo workspaceItemInfo : workspaceItemInfos) {
|
||||
workspaceItemInfo.updateFromDeepShortcutInfo(fullDetails, context);
|
||||
// If the shortcut is pinned but no longer has an icon in the system,
|
||||
// keep the current icon instead of reverting to the default icon.
|
||||
LauncherIcons li = LauncherIcons.obtain(context);
|
||||
workspaceItemInfo.bitmap = li.createShortcutIcon(
|
||||
fullDetails, true, () -> workspaceItemInfo);
|
||||
li.recycle();
|
||||
app.getIconCache().getShortcutIcon(workspaceItemInfo, fullDetails);
|
||||
updatedWorkspaceItemInfos.add(workspaceItemInfo);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user