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

Commit d80b89b7 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

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



Change-Id: Ibe5abe3910d34d49f013f06a96d0cbe58fd45d35
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0c2ff0b9 0c72cf7f
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;
        }
    }

    /**