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

Commit a4856a6b authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7090785 from 0b3194c9 to sc-release

Change-Id: If41db6d2f332eccb238991d49bb24902296abfa8
parents f57a6dbc 0b3194c9
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.graphics.drawable.AdaptiveIconDrawable;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.InsetDrawable;
import android.os.Build;
import android.os.Process;
import android.os.UserHandle;
@@ -152,6 +153,20 @@ public class BaseIconFactory implements AutoCloseable {
        return BitmapInfo.of(icon, extractColor(icon));
    }

    /**
     * Creates an icon from the bitmap cropped to the current device icon shape
     */
    public BitmapInfo createShapedIconBitmap(Bitmap icon, UserHandle user) {
        Drawable d = new FixedSizeBitmapDrawable(icon);
        if (ATLEAST_OREO) {
            float inset = AdaptiveIconDrawable.getExtraInsetFraction();
            inset = inset / (1 + 2 * inset);
            d = new AdaptiveIconDrawable(new ColorDrawable(Color.BLACK),
                    new InsetDrawable(d, inset, inset, inset, inset));
        }
        return createBadgedIconBitmap(d, user, true);
    }

    public BitmapInfo createBadgedIconBitmap(Drawable icon, UserHandle user,
            boolean shrinkNonAdaptiveIcons) {
        return createBadgedIconBitmap(icon, user, shrinkNonAdaptiveIcons, false, null);
+1 −1
Original line number Diff line number Diff line
@@ -396,7 +396,7 @@ public abstract class BaseIconCache {
        }
        if (icon != null) {
            BaseIconFactory li = getIconFactory();
            entry.bitmap = li.createIconBitmap(icon);
            entry.bitmap = li.createShapedIconBitmap(icon, user);
            li.close();
        }
        if (!TextUtils.isEmpty(title) && entry.bitmap.icon != null) {
+5 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
package com.android.app.search;

/**
 * Constants to be used with {@link android.app.search.SearchTarget}.
 * Constants to be used with {@link SearchTarget}.
 */
public class LayoutType {

@@ -48,6 +48,10 @@ public class LayoutType {
    public static final String ICON_DOUBLE_HORIZONTAL_TEXT_BUTTON =
        "icon_texts_button";


    // TODO: add diagram
    public static final String ICON_SLICE = "slice";

    // TODO: add diagram
    public static final String TEXT_HEADER = "header";

+3 −2
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ public class ResultType {
    public static final int ACTION = 1 << 3;
    public static final int SETTING = 1 << 4;
    public static final int SCREENSHOT = 1 << 5;
    public static final int TIPS = 1 << 2;
    public static final int WIDGETS = 1 << 3;
    public static final int TIPS = 1 << 6;
    public static final int WIDGETS = 1 << 7;
    public static final int PLAY = 1 << 8;
}