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

Commit d0993b2b authored by Hai Zhang's avatar Hai Zhang Committed by android-build-merger
Browse files

Align badging logic with platform IconDrawableFactory.

am: b0be237b

Change-Id: I4cb15de478dd232e3f16c00b379b89a921b6d4a4
parents 1a01d4fe b0be237b
Loading
Loading
Loading
Loading
+7 −10
Original line number Diff line number Diff line
@@ -161,22 +161,19 @@ public class BaseIconFactory implements AutoCloseable {
            mCanvas.setBitmap(null);
        }

        final Bitmap result;
        if (user != null && !Process.myUserHandle().equals(user)) {
        if (isInstantApp) {
            badgeWithDrawable(bitmap, mContext.getDrawable(R.drawable.ic_instant_app_badge));
        }
        if (user != null) {
            BitmapDrawable drawable = new FixedSizeBitmapDrawable(bitmap);
            Drawable badged = mPm.getUserBadgedIcon(drawable, user);
            if (badged instanceof BitmapDrawable) {
                result = ((BitmapDrawable) badged).getBitmap();
                bitmap = ((BitmapDrawable) badged).getBitmap();
            } else {
                result = createIconBitmap(badged, 1f);
                bitmap = createIconBitmap(badged, 1f);
            }
        } else if (isInstantApp) {
            badgeWithDrawable(bitmap, mContext.getDrawable(R.drawable.ic_instant_app_badge));
            result = bitmap;
        } else {
            result = bitmap;
        }
        return BitmapInfo.fromBitmap(result, mDisableColorExtractor ? null : mColorExtractor);
        return BitmapInfo.fromBitmap(bitmap, mDisableColorExtractor ? null : mColorExtractor);
    }

    public Bitmap createScaledBitmapWithoutShadow(Drawable icon, boolean shrinkNonAdaptiveIcons) {