Merge "Fixing drawable cloning does not preserve badge"

This commit is contained in:
TreeHugger Robot
2021-12-16 18:03:42 +00:00
committed by Android (Google) Code Review
@@ -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;
}
}
}