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

Commit bb903c9c authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Using generated monochrome icon when actual icon is not available in the full drawable

Also simplifying the bitmap fetching path to return all relevant data in one-call

Bug: 299336510
Test: Verified that the icons are themed during drag and app launch
Flag: ENABLE_FORCED_MONO_ICON
Change-Id: Ib4c457e911e7b5616e8370d111cc68c5d6401fe6
parent 1c14e5e8
Loading
Loading
Loading
Loading
+90 −71
Original line number Original line Diff line number Diff line
@@ -16,13 +16,14 @@


package com.android.launcher3;
package com.android.launcher3;


import static android.graphics.drawable.AdaptiveIconDrawable.getExtraInsetFraction;

import static com.android.launcher3.icons.BitmapInfo.FLAG_THEMED;
import static com.android.launcher3.icons.BitmapInfo.FLAG_THEMED;
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_ICON_BADGED;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_TYPE_MAIN;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_TYPE_MAIN;


import android.annotation.TargetApi;
import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.app.ActivityManager;
import android.app.ActivityOptions;
import android.app.ActivityOptions;
import android.app.Person;
import android.app.Person;
@@ -33,6 +34,9 @@ import android.content.pm.LauncherApps;
import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutInfo;
import android.content.res.Configuration;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BlendMode;
import android.graphics.BlendModeColorFilter;
import android.graphics.Color;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.ColorFilter;
import android.graphics.LightingColorFilter;
import android.graphics.LightingColorFilter;
@@ -43,8 +47,10 @@ import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.RectF;
import android.graphics.drawable.AdaptiveIconDrawable;
import android.graphics.drawable.AdaptiveIconDrawable;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.InsetDrawable;
import android.os.Build;
import android.os.Build;
import android.os.Build.VERSION_CODES;
import android.os.Build.VERSION_CODES;
import android.os.DeadObjectException;
import android.os.DeadObjectException;
@@ -59,6 +65,7 @@ import android.text.TextUtils;
import android.text.style.TtsSpan;
import android.text.style.TtsSpan;
import android.util.DisplayMetrics;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.Log;
import android.util.Pair;
import android.util.TypedValue;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.View;
@@ -68,10 +75,13 @@ import android.view.animation.Interpolator;
import androidx.annotation.ChecksSdkIntAtLeast;
import androidx.annotation.ChecksSdkIntAtLeast;
import androidx.annotation.IntDef;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
import androidx.core.graphics.ColorUtils;
import androidx.core.graphics.ColorUtils;


import com.android.launcher3.dragndrop.FolderAdaptiveIcon;
import com.android.launcher3.dragndrop.FolderAdaptiveIcon;
import com.android.launcher3.graphics.TintedDrawableSpan;
import com.android.launcher3.graphics.TintedDrawableSpan;
import com.android.launcher3.icons.LauncherIcons;
import com.android.launcher3.icons.ShortcutCachingLogic;
import com.android.launcher3.icons.ShortcutCachingLogic;
import com.android.launcher3.icons.ThemedIconDrawable;
import com.android.launcher3.icons.ThemedIconDrawable;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.ItemInfo;
@@ -571,103 +581,112 @@ public final class Utilities {
    }
    }


    /**
    /**
     * Returns the full drawable for info without any flattening or pre-processing.
     * Returns the full drawable for info as multiple layers of AdaptiveIconDrawable. The second
     * drawable in the Pair is the badge used with the icon.
     *
     *
     * @param shouldThemeIcon If true, will theme icons when applicable
     * @param useTheme If true, will theme icons when applicable
     * @param outObj this is set to the internal data associated with {@code info},
     *               eg {@link LauncherActivityInfo} or {@link ShortcutInfo}.
     */
     */
    @TargetApi(Build.VERSION_CODES.TIRAMISU)
    @SuppressLint("UseCompatLoadingForDrawables")
    public static Drawable getFullDrawable(Context context, ItemInfo info, int width, int height,
    @Nullable
            boolean shouldThemeIcon, Object[] outObj, boolean[] outIsIconThemed) {
    @WorkerThread
        Drawable icon = loadFullDrawableWithoutTheme(context, info, width, height, outObj);
    public static <T extends Context & ActivityContext> Pair<AdaptiveIconDrawable, Drawable>
        if (ATLEAST_T && icon instanceof AdaptiveIconDrawable && shouldThemeIcon) {
            getFullDrawable(T context, ItemInfo info, int width, int height, boolean useTheme) {
            AdaptiveIconDrawable aid = (AdaptiveIconDrawable) icon.mutate();
        useTheme &= Themes.isThemedIconEnabled(context);
            Drawable mono = aid.getMonochrome();
        LauncherAppState appState = LauncherAppState.getInstance(context);
            if (mono != null && Themes.isThemedIconEnabled(context)) {
        Drawable mainIcon = null;
                outIsIconThemed[0] = true;

                int[] colors = ThemedIconDrawable.getColors(context);
        Drawable badge = null;
                mono = mono.mutate();
        if ((info instanceof ItemInfoWithIcon iiwi) && !iiwi.usingLowResIcon()) {
                mono.setTint(colors[1]);
            badge = iiwi.bitmap.getBadgeDrawable(context, useTheme);
                return new AdaptiveIconDrawable(new ColorDrawable(colors[0]), mono);
            }
        }
        return icon;
        }
        }


    private static Drawable loadFullDrawableWithoutTheme(Context context, ItemInfo info,
            int width, int height, Object[] outObj) {
        ActivityContext activity = ActivityContext.lookupContext(context);
        LauncherAppState appState = LauncherAppState.getInstance(context);
        if (info instanceof PendingAddShortcutInfo) {
        if (info instanceof PendingAddShortcutInfo) {
            ShortcutConfigActivityInfo activityInfo =
            ShortcutConfigActivityInfo activityInfo =
                    ((PendingAddShortcutInfo) info).getActivityInfo(context);
                    ((PendingAddShortcutInfo) info).getActivityInfo(context);
            outObj[0] = activityInfo;
            mainIcon = activityInfo.getFullResIcon(appState.getIconCache());
            return activityInfo.getFullResIcon(appState.getIconCache());
        } else if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION) {
        }
        if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION) {
            LauncherActivityInfo activityInfo = context.getSystemService(LauncherApps.class)
            LauncherActivityInfo activityInfo = context.getSystemService(LauncherApps.class)
                    .resolveActivity(info.getIntent(), info.user);
                    .resolveActivity(info.getIntent(), info.user);
            outObj[0] = activityInfo;
            if (activityInfo == null) {
            return activityInfo == null ? null : LauncherAppState.getInstance(context)
                return null;
                    .getIconProvider().getIcon(
            }
                            activityInfo, activity.getDeviceProfile().inv.fillResIconDpi);
            mainIcon = appState.getIconProvider().getIcon(
                    activityInfo, appState.getInvariantDeviceProfile().fillResIconDpi);
        } else if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) {
        } else if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) {
            List<ShortcutInfo> si = ShortcutKey.fromItemInfo(info)
            List<ShortcutInfo> siList = ShortcutKey.fromItemInfo(info)
                    .buildRequest(context)
                    .buildRequest(context)
                    .query(ShortcutRequest.ALL);
                    .query(ShortcutRequest.ALL);
            if (si.isEmpty()) {
            if (siList.isEmpty()) {
                return null;
                return null;
            } else {
            } else {
                outObj[0] = si.get(0);
                ShortcutInfo si = siList.get(0);
                return ShortcutCachingLogic.getIcon(context, si.get(0),
                mainIcon = ShortcutCachingLogic.getIcon(context, si,
                        appState.getInvariantDeviceProfile().fillResIconDpi);
                        appState.getInvariantDeviceProfile().fillResIconDpi);
                // Only fetch badge if the icon is on workspace
                if (info.id != ItemInfo.NO_ID && badge == null) {
                    badge = appState.getIconCache().getShortcutInfoBadge(si)
                            .newIcon(context, FLAG_THEMED);
                }
            }
            }
        } else if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_FOLDER) {
        } else if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_FOLDER) {
            FolderAdaptiveIcon icon = FolderAdaptiveIcon.createFolderAdaptiveIcon(
            FolderAdaptiveIcon icon = FolderAdaptiveIcon.createFolderAdaptiveIcon(
                    activity, info.id, new Point(width, height));
                    context, info.id, new Point(width, height));
            if (icon == null) {
            if (icon == null) {
                return null;
                return null;
            }
            }
            outObj[0] = icon;
            mainIcon =  icon;
            return icon;
            badge = icon.getBadge();
        } else if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_SEARCH_ACTION
        }
                && info instanceof ItemInfoWithIcon) {

            return ((ItemInfoWithIcon) info).bitmap.newIcon(context);
        if (mainIcon == null) {
            return null;
        }
        AdaptiveIconDrawable result;
        if (mainIcon instanceof AdaptiveIconDrawable aid) {
            result = aid;
        } else {
        } else {
            // Wrap the main icon in AID
            try (LauncherIcons li = LauncherIcons.obtain(context)) {
                result = li.wrapToAdaptiveIcon(mainIcon);
            }
        }
        if (result == null) {
            return null;
            return null;
        }
        }

        // Inject monochrome icon drawable
        if (ATLEAST_T && useTheme) {
            result.mutate();
            int[] colors = ThemedIconDrawable.getColors(context);
            Drawable mono = result.getMonochrome();

            if (mono != null) {
                mono.setTint(colors[1]);
            } else  if (info instanceof ItemInfoWithIcon iiwi) {
                // Inject a previously generated monochrome icon
                Bitmap monoBitmap = iiwi.bitmap.getMono();
                if (monoBitmap != null) {
                    // Use BitmapDrawable instead of FastBitmapDrawable so that the colorState is
                    // preserved in constantState
                    mono = new BitmapDrawable(monoBitmap);
                    mono.setColorFilter(new BlendModeColorFilter(colors[1], BlendMode.SRC_IN));
                    // Inset the drawable according to the AdaptiveIconDrawable layers
                    mono = new InsetDrawable(mono, getExtraInsetFraction() / 2);
                }
            }
            if (mono != null) {
                result = new AdaptiveIconDrawable(new ColorDrawable(colors[0]), mono);
            }
        }
        }


    /**
        if (badge == null) {
     * For apps icons and shortcut icons that have badges, this method creates a drawable that can
            badge = Process.myUserHandle().equals(info.user)
     * later on be rendered on top of the layers for the badges. For app icons, work profile badges
     * can only be applied. For deep shortcuts, when dragged from the pop up container, there's no
     * badge. When dragged from workspace or folder, it may contain app AND/OR work profile badge
     **/
    @TargetApi(Build.VERSION_CODES.O)
    public static Drawable getBadge(Context context, ItemInfo info, Object obj,
            boolean isIconThemed) {
        LauncherAppState appState = LauncherAppState.getInstance(context);
        if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) {
            boolean iconBadged = (info instanceof ItemInfoWithIcon)
                    && (((ItemInfoWithIcon) info).runtimeStatusFlags & FLAG_ICON_BADGED) > 0;
            if ((info.id == ItemInfo.NO_ID && !iconBadged)
                    || !(obj instanceof ShortcutInfo)) {
                // The item is not yet added on home screen.
                return new ColorDrawable(Color.TRANSPARENT);
            }
            ShortcutInfo si = (ShortcutInfo) obj;
            return LauncherAppState.getInstance(appState.getContext())
                    .getIconCache().getShortcutInfoBadge(si).newIcon(context, FLAG_THEMED);
        } else if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_FOLDER) {
            return ((FolderAdaptiveIcon) obj).getBadge();
        } else {
            return Process.myUserHandle().equals(info.user)
                    ? new ColorDrawable(Color.TRANSPARENT)
                    ? new ColorDrawable(Color.TRANSPARENT)
                    : context.getDrawable(isIconThemed
                    : context.getDrawable(useTheme
                            ? R.drawable.ic_work_app_badge_themed : R.drawable.ic_work_app_badge);
                            ? R.drawable.ic_work_app_badge_themed
                            : R.drawable.ic_work_app_badge);
        }
        }
        return Pair.create(result, badge);
    }
    }


    public static float squaredHypot(float x, float y) {
    public static float squaredHypot(float x, float y) {
+10 −20
Original line number Original line Diff line number Diff line
@@ -20,7 +20,6 @@ import static android.view.View.MeasureSpec.EXACTLY;
import static android.view.View.MeasureSpec.makeMeasureSpec;
import static android.view.View.MeasureSpec.makeMeasureSpec;


import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA;
import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA;
import static com.android.launcher3.Utilities.getBadge;
import static com.android.launcher3.icons.FastBitmapDrawable.getDisabledColorFilter;
import static com.android.launcher3.icons.FastBitmapDrawable.getDisabledColorFilter;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;


@@ -45,6 +44,7 @@ import android.graphics.drawable.PictureDrawable;
import android.os.Build;
import android.os.Build;
import android.os.Handler;
import android.os.Handler;
import android.os.Looper;
import android.os.Looper;
import android.util.Pair;
import android.view.View;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.FrameLayout;
@@ -244,13 +244,12 @@ public abstract class DragView<T extends Context & ActivityContext> extends Fram
    public void setItemInfo(final ItemInfo info) {
    public void setItemInfo(final ItemInfo info) {
        // Load the adaptive icon on a background thread and add the view in ui thread.
        // Load the adaptive icon on a background thread and add the view in ui thread.
        MODEL_EXECUTOR.getHandler().postAtFrontOfQueue(() -> {
        MODEL_EXECUTOR.getHandler().postAtFrontOfQueue(() -> {
            Object[] outObj = new Object[1];
            boolean[] outIsIconThemed = new boolean[1];
            int w = mWidth;
            int w = mWidth;
            int h = mHeight;
            int h = mHeight;
            Drawable dr = Utilities.getFullDrawable(mActivity, info, w, h,
            Pair<AdaptiveIconDrawable, Drawable> fullDrawable = Utilities.getFullDrawable(
                    true /* shouldThemeIcon */, outObj, outIsIconThemed);
                    mActivity, info, w, h, true /* shouldThemeIcon */);
            if (dr instanceof AdaptiveIconDrawable) {
            if (fullDrawable != null) {
                AdaptiveIconDrawable adaptiveIcon = fullDrawable.first;
                int blurMargin = (int) mActivity.getResources()
                int blurMargin = (int) mActivity.getResources()
                        .getDimension(R.dimen.blur_size_medium_outline) / 2;
                        .getDimension(R.dimen.blur_size_medium_outline) / 2;


@@ -258,24 +257,15 @@ public abstract class DragView<T extends Context & ActivityContext> extends Fram
                bounds.inset(blurMargin, blurMargin);
                bounds.inset(blurMargin, blurMargin);
                // Badge is applied after icon normalization so the bounds for badge should not
                // Badge is applied after icon normalization so the bounds for badge should not
                // be scaled down due to icon normalization.
                // be scaled down due to icon normalization.
                mBadge = getBadge(mActivity, info, outObj[0], outIsIconThemed[0]);
                mBadge = fullDrawable.second;
                FastBitmapDrawable.setBadgeBounds(mBadge, bounds);
                FastBitmapDrawable.setBadgeBounds(mBadge, bounds);


                // Do not draw the background in case of folder as its translucent
                final boolean shouldDrawBackground = !(dr instanceof FolderAdaptiveIcon);

                try (LauncherIcons li = LauncherIcons.obtain(mActivity)) {
                try (LauncherIcons li = LauncherIcons.obtain(mActivity)) {
                    Drawable nDr; // drawable to be normalized
                    if (shouldDrawBackground) {
                        nDr = dr;
                    } else {
                    // Since we just want the scale, avoid heavy drawing operations
                    // Since we just want the scale, avoid heavy drawing operations
                        nDr = new AdaptiveIconDrawable(new ColorDrawable(Color.BLACK), null);
                    Utilities.scaleRectAboutCenter(bounds, li.getNormalizer().getScale(
                    }
                            new AdaptiveIconDrawable(new ColorDrawable(Color.BLACK), null),
                    Utilities.scaleRectAboutCenter(bounds,
                            null, null, null));
                            li.getNormalizer().getScale(nDr, null, null, null));
                }
                }
                AdaptiveIconDrawable adaptiveIcon = (AdaptiveIconDrawable) dr;


                // Shrink very tiny bit so that the clip path is smaller than the original bitmap
                // Shrink very tiny bit so that the clip path is smaller than the original bitmap
                // that has anti aliased edges and shadows.
                // that has anti aliased edges and shadows.
+0 −8
Original line number Original line Diff line number Diff line
@@ -23,8 +23,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.LauncherActivityInfo;
import android.content.pm.LauncherActivityInfo;
import android.os.Build;
import android.os.Process;
import android.os.UserHandle;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.UserManager;


@@ -177,12 +175,6 @@ public class AppInfo extends ItemInfoWithIcon implements WorkspaceItemFactory {
        info.runtimeStatusFlags |= (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0
        info.runtimeStatusFlags |= (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0
                ? FLAG_SYSTEM_NO : FLAG_SYSTEM_YES;
                ? FLAG_SYSTEM_NO : FLAG_SYSTEM_YES;


        if (appInfo.targetSdkVersion >= Build.VERSION_CODES.O
                && Process.myUserHandle().equals(lai.getUser())) {
            // The icon for a non-primary user is badged, hence it's not exactly an adaptive icon.
            info.runtimeStatusFlags |= FLAG_ADAPTIVE_ICON;
        }

        // Sets the progress level, installation and incremental download flags.
        // Sets the progress level, installation and incremental download flags.
        info.setProgressLevel(
        info.setProgressLevel(
                PackageManagerHelper.getLoadingProgress(lai),
                PackageManagerHelper.getLoadingProgress(lai),
+0 −11
Original line number Original line Diff line number Diff line
@@ -82,17 +82,6 @@ public abstract class ItemInfoWithIcon extends ItemInfo {


    public static final int FLAG_SYSTEM_MASK = FLAG_SYSTEM_YES | FLAG_SYSTEM_NO;
    public static final int FLAG_SYSTEM_MASK = FLAG_SYSTEM_YES | FLAG_SYSTEM_NO;


    /**
     * Flag indicating that the icon is an {@link android.graphics.drawable.AdaptiveIconDrawable}
     * that can be optimized in various way.
     */
    public static final int FLAG_ADAPTIVE_ICON = 1 << 8;

    /**
     * Flag indicating that the icon is badged.
     */
    public static final int FLAG_ICON_BADGED = 1 << 9;

    /**
    /**
     * The icon is being installed. If {@link WorkspaceItemInfo#FLAG_RESTORED_ICON} or
     * The icon is being installed. If {@link WorkspaceItemInfo#FLAG_RESTORED_ICON} or
     * {@link WorkspaceItemInfo#FLAG_AUTOINSTALL_ICON} is set, then the icon is either being
     * {@link WorkspaceItemInfo#FLAG_AUTOINSTALL_ICON} is set, then the icon is either being
+13 −21
Original line number Original line Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.launcher3.views;
import static android.view.Gravity.LEFT;
import static android.view.Gravity.LEFT;


import static com.android.app.animation.Interpolators.LINEAR;
import static com.android.app.animation.Interpolators.LINEAR;
import static com.android.launcher3.Utilities.getBadge;
import static com.android.launcher3.Utilities.getFullDrawable;
import static com.android.launcher3.Utilities.getFullDrawable;
import static com.android.launcher3.Utilities.mapToRange;
import static com.android.launcher3.Utilities.mapToRange;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
@@ -36,6 +35,7 @@ import android.os.Build;
import android.os.CancellationSignal;
import android.os.CancellationSignal;
import android.util.AttributeSet;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Log;
import android.util.Pair;
import android.view.View;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
@@ -288,28 +288,20 @@ public class FloatingIconView extends FrameLayout implements
        } else {
        } else {
            int width = (int) pos.width();
            int width = (int) pos.width();
            int height = (int) pos.height();
            int height = (int) pos.height();
            Object[] tmpObjArray = new Object[1];
            Pair<AdaptiveIconDrawable, Drawable> fullIcon = null;
            boolean[] outIsIconThemed = new boolean[1];
            if (supportsAdaptiveIcons) {
            if (supportsAdaptiveIcons) {
                boolean shouldThemeIcon = btvIcon instanceof FastBitmapDrawable
                boolean shouldThemeIcon = (btvIcon instanceof FastBitmapDrawable fbd)
                        && ((FastBitmapDrawable) btvIcon).isThemed();
                        && fbd.isCreatedForTheme();
                drawable = getFullDrawable(
                fullIcon = getFullDrawable(l, info, width, height, shouldThemeIcon);
                        l, info, width, height, shouldThemeIcon, tmpObjArray, outIsIconThemed);
            } else if (!(originalView instanceof BubbleTextView)) {
                if (drawable instanceof AdaptiveIconDrawable) {
                fullIcon = getFullDrawable(l, info, width, height, true /* shouldThemeIcon */);
                    badge = getBadge(l, info, tmpObjArray[0], outIsIconThemed[0]);
                } else {
                    // The drawable we get back is not an adaptive icon, so we need to use the
                    // BubbleTextView icon that is already legacy treated.
                    drawable = btvIcon;
            }
            }

            if (fullIcon != null) {
                drawable = fullIcon.first;
                badge = fullIcon.second;
            } else {
            } else {
                if (originalView instanceof BubbleTextView) {
                    // Similar to DragView, we simply use the BubbleTextView icon here.
                drawable = btvIcon;
                drawable = btvIcon;
                } else {
                    drawable = getFullDrawable(l, info, width, height, true /* shouldThemeIcon */,
                            tmpObjArray, outIsIconThemed);
                }
            }
            }
        }
        }