Revert "Revert "Removing unnecessary iconFactory class when gene..."

Revert submission 25518508-revert-25483550-themed-badge-GJNKEECDMN

Reason for revert: Fixed badging bug

Reverted changes: /q/submissionid:25518508-revert-25483550-themed-badge-GJNKEECDMN

Change-Id: I0f378eaabcb7bdea855b80a33bdec007c9b11436
This commit is contained in:
Sunny Goyal
2023-12-04 18:53:47 +00:00
committed by Android (Google) Code Review
parent dad66f4188
commit 3de59f24a0
2 changed files with 12 additions and 18 deletions

View File

@@ -79,7 +79,6 @@ import androidx.core.graphics.ColorUtils;
import com.android.launcher3.dragndrop.FolderAdaptiveIcon;
import com.android.launcher3.graphics.TintedDrawableSpan;
import com.android.launcher3.icons.BaseIconFactory;
import com.android.launcher3.icons.BitmapInfo;
import com.android.launcher3.icons.LauncherIcons;
import com.android.launcher3.icons.ShortcutCachingLogic;
@@ -91,6 +90,7 @@ import com.android.launcher3.pm.UserCache;
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.shortcuts.ShortcutRequest;
import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.util.FlagOp;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
import com.android.launcher3.util.Themes;
@@ -676,12 +676,11 @@ public final class Utilities {
}
if (badge == null) {
try (LauncherIcons li = LauncherIcons.obtain(context)) {
badge = BitmapInfo.LOW_RES_INFO.withFlags(
li.getBitmapFlagOp(new BaseIconFactory.IconOptions().setUser(
UserCache.INSTANCE.get(context).getUserInfo(info.user))))
.getBadgeDrawable(context, useTheme);
}
badge = BitmapInfo.LOW_RES_INFO.withFlags(
UserCache.INSTANCE.get(context)
.getUserInfo(info.user)
.applyBitmapInfoFlags(FlagOp.NO_OP))
.getBadgeDrawable(context, useTheme);
if (badge == null) {
badge = new ColorDrawable(Color.TRANSPARENT);
}