mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 08:56:55 +00:00
Revert "fetch and update shortcut icons in background thread"
This reverts commit 4ec390e490.
Reason for revert: the code change introduces significant delay when saving deep shortcut icons in cache.
Bug: 142514365
Change-Id: If7a69844aba7f32690ff347f2db11f0a8041b9e4
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package com.android.launcher3.pm;
|
||||
|
||||
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
|
||||
import static com.android.launcher3.util.ShortcutUtil.fetchAndUpdateShortcutIconAsync;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
@@ -30,7 +29,9 @@ import android.os.Parcelable;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
import com.android.launcher3.WorkspaceItemInfo;
|
||||
import com.android.launcher3.icons.LauncherIcons;
|
||||
|
||||
public class PinRequestHelper {
|
||||
|
||||
@@ -80,7 +81,11 @@ public class PinRequestHelper {
|
||||
ShortcutInfo si = request.getShortcutInfo();
|
||||
WorkspaceItemInfo info = new WorkspaceItemInfo(si, context);
|
||||
// Apply the unbadged icon and fetch the actual icon asynchronously.
|
||||
fetchAndUpdateShortcutIconAsync(context, info, si, false);
|
||||
LauncherIcons li = LauncherIcons.obtain(context);
|
||||
info.applyFrom(li.createShortcutIcon(si, false /* badged */));
|
||||
li.recycle();
|
||||
LauncherAppState.getInstance(context).getModel()
|
||||
.updateAndBindWorkspaceItem(info, si);
|
||||
return info;
|
||||
} else {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user