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

Commit ef5159e8 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Request high res icons for app pairs after all workspace items processed

* TL;DR Loading workspace icons only requests high res icons for apps
on workspace or in hotseat, not for folders or app pairs. They need to
request that separately
* See notes on bug for root cause

Test: Created many app pairs, empty icons does not repro.
If I remove my change issue consistently repros, not a race condition
Fixes: 323106492

Change-Id: I05ba5e8e8b0eddd4041642f89d06deff85511e40
parent 3a8d4f51
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -475,11 +475,23 @@ public class LoaderTask implements Runnable {
            mItemsDeleted = c.commitDeleted();
            mItemsDeleted = c.commitDeleted();


            processFolderItems();
            processFolderItems();
            processAppPairItems();


            c.commitRestoredItems();
            c.commitRestoredItems();
        }
        }
    }
    }


    /**
     * After all items have been processed and added to the BgDataModel, this method requests
     * high-res icons for the items that are part of an app pair
     */
    private void processAppPairItems() {
        mBgDataModel.workspaceItems.stream()
                .filter((itemInfo -> itemInfo.itemType == ITEM_TYPE_APP_PAIR))
                .forEach(fi -> ((FolderInfo) fi).contents.forEach(item ->
                        mIconCache.getTitleAndIcon(item, false /*useLowResIcon*/)));
    }

    /**
    /**
     * Initialized the UserManagerState, and determines which users are unlocked. Additionally, if
     * Initialized the UserManagerState, and determines which users are unlocked. Additionally, if
     * the user is unlocked, it queries LauncherAppsService for pinned shortcuts and stores the
     * the user is unlocked, it queries LauncherAppsService for pinned shortcuts and stores the