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

Commit 58acb262 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Adding support for overriding bitmap mode during icon generation" into...

Merge "Adding support for overriding bitmap mode during icon generation" into tm-qpr-dev am: 0c72cf7f am: d80b89b7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/libs/systemui/+/21325383



Change-Id: I084287443d285bcace8b0e8bf6af4795ecf45212
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b7d619aa d80b89b7
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -212,7 +212,8 @@ public class BaseIconFactory implements AutoCloseable {
        boolean shrinkNonAdaptiveIcons = options == null || options.mShrinkNonAdaptiveIcons;
        float[] scale = new float[1];
        icon = normalizeAndWrapToAdaptiveIcon(icon, shrinkNonAdaptiveIcons, null, scale);
        Bitmap bitmap = createIconBitmap(icon, scale[0], MODE_WITH_SHADOW);
        Bitmap bitmap = createIconBitmap(icon, scale[0],
                options == null ? MODE_WITH_SHADOW : options.mGenerationMode);

        int color = (options != null && options.mExtractedColor != null)
                ? options.mExtractedColor : mColorExtractor.findDominantColorByHue(bitmap);
@@ -463,6 +464,9 @@ public class BaseIconFactory implements AutoCloseable {

        boolean mIsInstantApp;

        @BitmapGenerationMode
        int mGenerationMode = MODE_WITH_SHADOW;

        @Nullable UserHandle mUserHandle;

        @ColorInt
@@ -503,6 +507,16 @@ public class BaseIconFactory implements AutoCloseable {
            mExtractedColor = color;
            return this;
        }

        /**
         * Sets the bitmap generation mode to use for the bitmap info. Note that some generation
         * modes do not support color extraction, so consider setting a extracted color manually
         * in those cases.
         */
        public IconOptions setBitmapGenerationMode(@BitmapGenerationMode int generationMode) {
            mGenerationMode = generationMode;
            return this;
        }
    }

    /**