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

Commit ffb26646 authored by Rohit Goyal's avatar Rohit Goyal Committed by Android (Google) Code Review
Browse files

Merge "UI Improvement: Do not add archived app icon to workspace when...

Merge "UI Improvement: Do not add archived app icon to workspace when unarchival starts in case the icon already doesn't exist." into main
parents 08b2acf8 25ef2e1e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import com.android.launcher3.model.BgDataModel.Callbacks;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.FolderInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.ItemInfoWithIcon;
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
import com.android.launcher3.model.data.WorkspaceItemFactory;
import com.android.launcher3.model.data.WorkspaceItemInfo;
@@ -102,6 +103,11 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
                            Objects.requireNonNull(item.getIntent()))) {
                        continue;
                    }

                    if (item instanceof ItemInfoWithIcon
                            && ((ItemInfoWithIcon) item).isArchived()) {
                        continue;
                    }
                }

                if (item.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION) {
+6 −0
Original line number Diff line number Diff line
@@ -18,10 +18,12 @@ package com.android.launcher3.model;

import static android.appwidget.AppWidgetManager.EXTRA_APPWIDGET_ID;

import static com.android.launcher3.Flags.enableSupportForArchiving;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT;
import static com.android.launcher3.model.data.AppInfo.makeLaunchIntent;
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_ARCHIVED;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;

import android.appwidget.AppWidgetManager;
@@ -276,6 +278,7 @@ public class ItemInstallQueue {
            return intent;
        }

        @SuppressWarnings("NewApi")
        public Pair<ItemInfo, Object> getItemInfo(Context context) {
            switch (itemType) {
                case ITEM_TYPE_APPLICATION: {
@@ -297,6 +300,9 @@ public class ItemInstallQueue {
                    } else {
                        lai = laiList.get(0);
                        si.intent = makeLaunchIntent(lai);
                        if (enableSupportForArchiving() && lai.getActivityInfo().isArchived) {
                            si.runtimeStatusFlags |= FLAG_ARCHIVED;
                        }
                    }
                    LauncherAppState.getInstance(context).getIconCache()
                            .getTitleAndIcon(si, () -> lai, usePackageIcon, false);