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

Commit f26dbd8f authored by Daniel Nishi's avatar Daniel Nishi
Browse files

Fix the user profile icon.

It showing up regressed in MR1 for some reason. It appears that the icon
was never being loaded properly at all (drawables are not supposed to be
bitmappable as it was done before). By returning the raw drawable, the
icon is set properly.

Change-Id: I5f8e96b1b99dc725b8f69c6a5feb3fbfc05bb4d8
Fixes: 64610295
Test: Manual
parent 9c85d966
Loading
Loading
Loading
Loading
+3 −5
Original line number Original line Diff line number Diff line
@@ -14,6 +14,7 @@ import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.graphics.drawable.LayerDrawable;
import android.net.ConnectivityManager;
import android.net.ConnectivityManager;
@@ -95,13 +96,10 @@ public class Utils {
    /**
    /**
     * Returns a circular icon for a user.
     * Returns a circular icon for a user.
     */
     */
    public static UserIconDrawable getUserIcon(Context context, UserManager um, UserInfo user) {
    public static Drawable getUserIcon(Context context, UserManager um, UserInfo user) {
        final int iconSize = UserIconDrawable.getSizeForList(context);
        final int iconSize = UserIconDrawable.getSizeForList(context);
        if (user.isManagedProfile()) {
        if (user.isManagedProfile()) {
            // We use predefined values for managed profiles
            return context.getDrawable(com.android.internal.R.drawable.ic_corp_icon);
            Bitmap b = BitmapFactory.decodeResource(context.getResources(),
                    com.android.internal.R.drawable.ic_corp_icon);
            return new UserIconDrawable(iconSize).setIcon(b).bake();
        }
        }
        if (user.iconPath != null) {
        if (user.iconPath != null) {
            Bitmap icon = um.getUserIcon(user.id);
            Bitmap icon = um.getUserIcon(user.id);