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

Commit c20082bd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Change MaskableBitmap to AdaptiveBitmap Test: $ make dist -j30 b/35399620"

parents 0882330c e4179e2c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13831,12 +13831,12 @@ package android.graphics.drawable {
  }
  public final class Icon implements android.os.Parcelable {
    method public static android.graphics.drawable.Icon createWithAdaptiveBitmap(android.graphics.Bitmap);
    method public static android.graphics.drawable.Icon createWithBitmap(android.graphics.Bitmap);
    method public static android.graphics.drawable.Icon createWithContentUri(java.lang.String);
    method public static android.graphics.drawable.Icon createWithContentUri(android.net.Uri);
    method public static android.graphics.drawable.Icon createWithData(byte[], int, int);
    method public static android.graphics.drawable.Icon createWithFilePath(java.lang.String);
    method public static android.graphics.drawable.Icon createWithMaskableBitmap(android.graphics.Bitmap);
    method public static android.graphics.drawable.Icon createWithResource(android.content.Context, int);
    method public static android.graphics.drawable.Icon createWithResource(java.lang.String, int);
    method public int describeContents();
+1 −1
Original line number Diff line number Diff line
@@ -14466,12 +14466,12 @@ package android.graphics.drawable {
  }
  public final class Icon implements android.os.Parcelable {
    method public static android.graphics.drawable.Icon createWithAdaptiveBitmap(android.graphics.Bitmap);
    method public static android.graphics.drawable.Icon createWithBitmap(android.graphics.Bitmap);
    method public static android.graphics.drawable.Icon createWithContentUri(java.lang.String);
    method public static android.graphics.drawable.Icon createWithContentUri(android.net.Uri);
    method public static android.graphics.drawable.Icon createWithData(byte[], int, int);
    method public static android.graphics.drawable.Icon createWithFilePath(java.lang.String);
    method public static android.graphics.drawable.Icon createWithMaskableBitmap(android.graphics.Bitmap);
    method public static android.graphics.drawable.Icon createWithResource(android.content.Context, int);
    method public static android.graphics.drawable.Icon createWithResource(java.lang.String, int);
    method public int describeContents();
+1 −1
Original line number Diff line number Diff line
@@ -13869,12 +13869,12 @@ package android.graphics.drawable {
  }
  public final class Icon implements android.os.Parcelable {
    method public static android.graphics.drawable.Icon createWithAdaptiveBitmap(android.graphics.Bitmap);
    method public static android.graphics.drawable.Icon createWithBitmap(android.graphics.Bitmap);
    method public static android.graphics.drawable.Icon createWithContentUri(java.lang.String);
    method public static android.graphics.drawable.Icon createWithContentUri(android.net.Uri);
    method public static android.graphics.drawable.Icon createWithData(byte[], int, int);
    method public static android.graphics.drawable.Icon createWithFilePath(java.lang.String);
    method public static android.graphics.drawable.Icon createWithMaskableBitmap(android.graphics.Bitmap);
    method public static android.graphics.drawable.Icon createWithResource(android.content.Context, int);
    method public static android.graphics.drawable.Icon createWithResource(java.lang.String, int);
    method public int describeContents();
+2 −2
Original line number Diff line number Diff line
@@ -829,7 +829,7 @@ public class LauncherApps {
                final Bitmap bmp = BitmapFactory.decodeFileDescriptor(pfd.getFileDescriptor());
                if (bmp != null) {
                    BitmapDrawable dr = new BitmapDrawable(mContext.getResources(), bmp);
                    if (shortcut.hasMaskableBitmap()) {
                    if (shortcut.hasAdaptiveBitmap()) {
                        return new AdaptiveIconDrawable(null, dr);
                    } else {
                        return dr;
@@ -854,7 +854,7 @@ public class LauncherApps {
                            icon.getResId(), shortcut.getUserHandle(), density);
                }
                case Icon.TYPE_BITMAP:
                case Icon.TYPE_BITMAP_MASKABLE: {
                case Icon.TYPE_ADAPTIVE_BITMAP: {
                    return icon.loadDrawable(mContext);
                }
                default:
+8 −7
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ public final class ShortcutInfo implements Parcelable {
    public static final int FLAG_IMMUTABLE = 1 << 8;

    /** @hide */
    public static final int FLAG_MASKABLE_BITMAP = 1 << 9;
    public static final int FLAG_ADAPTIVE_BITMAP = 1 << 9;

    /** @hide */
    public static final int FLAG_CHOOSER = 1 << 10;
@@ -118,7 +118,7 @@ public final class ShortcutInfo implements Parcelable {
            FLAG_DISABLED,
            FLAG_STRINGS_RESOLVED,
            FLAG_IMMUTABLE,
            FLAG_MASKABLE_BITMAP,
            FLAG_ADAPTIVE_BITMAP,
            FLAG_CHOOSER,
    })
    @Retention(RetentionPolicy.SOURCE)
@@ -784,7 +784,7 @@ public final class ShortcutInfo implements Parcelable {
        switch (icon.getType()) {
            case Icon.TYPE_RESOURCE:
            case Icon.TYPE_BITMAP:
            case Icon.TYPE_BITMAP_MASKABLE:
            case Icon.TYPE_ADAPTIVE_BITMAP:
                break; // OK
            default:
                throw getInvalidIconException();
@@ -917,7 +917,7 @@ public final class ShortcutInfo implements Parcelable {
         * and will be ignored.
         *
         * <p>Only icons created with {@link Icon#createWithBitmap(Bitmap)},
         * {@link Icon#createWithMaskableBitmap(Bitmap)}
         * {@link Icon#createWithAdaptiveBitmap(Bitmap)}
         * and {@link Icon#createWithResource} are supported.
         * Other types, such as URI-based icons, are not supported.
         *
@@ -1615,12 +1615,13 @@ public final class ShortcutInfo implements Parcelable {
    }

    /**
     * Return whether a shortcut's icon is maskable.
     * Return whether a shortcut's icon is adaptive bitmap following design guideline
     * defined in {@link AdaptiveIconDrawable}.
     *
     * @hide internal/unit tests only
     */
    public boolean hasMaskableBitmap() {
        return hasFlags(FLAG_MASKABLE_BITMAP);
    public boolean hasAdaptiveBitmap() {
        return hasFlags(FLAG_ADAPTIVE_BITMAP);
    }

    /**
Loading