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

Commit 6507f2e0 authored by Robin Lee's avatar Robin Lee
Browse files

Badge document activities in Recents

The activity icon provided by the app should not be used directly as
icons from activities in other profiles need to be badged.

@bug 15689369

Change-Id: Iee34d296eacc8aeba58f671e3f6b681bc9826425
parent 0a493e87
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -306,6 +306,13 @@ public class SystemServicesProxy {
        }

        Drawable icon = info.loadIcon(mPm);
        return getBadgedIcon(icon, userId);
    }

    /**
     * Returns the given icon for a user, badging if necessary.
     */
    public Drawable getBadgedIcon(Drawable icon, int userId) {
        if (userId != UserHandle.myUserId()) {
            icon = mUm.getBadgedDrawableForUser(icon, new UserHandle(userId));
        }
+3 −2
Original line number Diff line number Diff line
@@ -410,11 +410,12 @@ public class RecentsTaskLoader {

            ActivityManager.TaskDescription av = t.taskDescription;
            String activityLabel = null;
            BitmapDrawable activityIcon = null;
            Drawable activityIcon = null;
            int activityColor = config.taskBarViewDefaultBackgroundColor;
            if (av != null) {
                activityLabel = (av.getLabel() != null ? av.getLabel() : ssp.getActivityLabel(info));
                activityIcon = (av.getIcon() != null) ? new BitmapDrawable(res, av.getIcon()) : null;
                activityIcon = (av.getIcon() != null) ?
                        ssp.getBadgedIcon(new BitmapDrawable(res, av.getIcon()), t.userId) : null;
                activityColor = av.getPrimaryColor();
            } else {
                activityLabel = ssp.getActivityLabel(info);
+1 −2
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.systemui.recents.model;

import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import com.android.systemui.recents.Utilities;

@@ -93,7 +92,7 @@ public class Task {
    }

    public Task(int id, boolean isActive, Intent intent, String activityTitle,
                BitmapDrawable activityIcon, int colorPrimary, int userId, long lastActiveTime) {
                Drawable activityIcon, int colorPrimary, int userId, long lastActiveTime) {
        this.key = new TaskKey(id, intent, userId, lastActiveTime);
        this.activityLabel = activityTitle;
        this.activityIcon = activityIcon;