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

Commit 8b77f368 authored by Himanshu Gupta's avatar Himanshu Gupta Committed by Automerger Merge Worker
Browse files

Merge "Clone profile badge resolution in settings." into udc-dev am: f45ad6f5

parents 3be48742 f45ad6f5
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -575,9 +575,15 @@ public class Utils {

    /** Get the corresponding adaptive icon drawable. */
    public static Drawable getBadgedIcon(Context context, Drawable icon, UserHandle user) {
        UserManager um = context.getSystemService(UserManager.class);
        boolean isClone = um.getProfiles(user.getIdentifier()).stream()
                .anyMatch(profile ->
                        profile.isCloneProfile() && profile.id == user.getIdentifier());
        try (IconFactory iconFactory = IconFactory.obtain(context)) {
            return iconFactory
                    .createBadgedIconBitmap(icon, new IconOptions().setUser(user))
                    .createBadgedIconBitmap(
                            icon,
                            new IconOptions().setUser(user).setIsCloneProfile(isClone))
                    .newIcon(context);
        }
    }