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

Commit 2193c390 authored by Thales Lima's avatar Thales Lima Committed by Android (Google) Code Review
Browse files

Merge "Adding some utility methods for testing" into main

parents 8eacc8c6 cd44941b
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static com.android.launcher3.icons.BaseIconFactory.getFullResDefaultActiv
import static com.android.launcher3.icons.BitmapInfo.LOW_RES_ICON;
import static com.android.launcher3.icons.GraphicsUtils.flattenBitmap;
import static com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound;
import static com.android.launcher3.icons.cache.IconCacheUpdateHandler.ICON_UPDATE_TOKEN;

import static java.util.Objects.requireNonNull;

@@ -499,9 +500,16 @@ public abstract class BaseIconCache {
                cachingLogic.getDescription(object, entry.title), user);
    }

    public synchronized void clear() {
    public synchronized void clearMemoryCache() {
        assertWorkerThread();
        mIconDb.clear();
        mCache.clear();
    }

    /**
     * Returns true if an icon update is in progress
     */
    public boolean isIconUpdateInProgress() {
        return mWorkerHandler.hasMessages(0, ICON_UPDATE_TOKEN);
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ public class IconCacheUpdateHandler {
     */
    private static final boolean MODE_CLEAR_VALID_ITEMS = false;

    private static final Object ICON_UPDATE_TOKEN = new Object();
    static final Object ICON_UPDATE_TOKEN = new Object();

    private final HashMap<String, PackageInfo> mPkgInfoMap;
    private final BaseIconCache mIconCache;