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

Commit 761327b1 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Fixing drawable cloning does not preserve badge

Bug: 209503720
Test: Manual
Change-Id: I77606c7067cad6d1faea3c57affd6dde317d06ac
parent 4f508c7f
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -345,11 +345,10 @@ public class PreloadIconDrawable extends FastBitmapDrawable {
    }

    @Override
    public ConstantState getConstantState() {
    public FastBitmapConstantState newConstantState() {
        return new PreloadIconConstantState(
                mBitmap,
                mIconColor,
                !mItem.isAppStartable(),
                mItem,
                mIndicatorColor,
                new int[] {mSystemAccentColor, mSystemBackgroundColor},
@@ -367,12 +366,11 @@ public class PreloadIconDrawable extends FastBitmapDrawable {
        public PreloadIconConstantState(
                Bitmap bitmap,
                int iconColor,
                boolean isDisabled,
                ItemInfoWithIcon info,
                int indicatorColor,
                int[] preloadColors,
                boolean isDarkMode) {
            super(bitmap, iconColor, isDisabled);
            super(bitmap, iconColor);
            mInfo = info;
            mIndicatorColor = indicatorColor;
            mPreloadColors = preloadColors;
@@ -381,17 +379,12 @@ public class PreloadIconDrawable extends FastBitmapDrawable {
        }

        @Override
        public PreloadIconDrawable newDrawable() {
        public PreloadIconDrawable createDrawable() {
            return new PreloadIconDrawable(
                    mInfo,
                    mIndicatorColor,
                    mPreloadColors,
                    mIsDarkMode);
        }

        @Override
        public int getChangingConfigurations() {
            return 0;
        }
    }
}