Corp badging for Recents
Badge apps that belong to the corp profile when shown in the recents list.
Add a userId to TaskKey to help with caching.
Bug: 11676348
Change-Id: I92c8262dce763de89497977fcc6a53899afda136
diff --git a/packages/SystemUI/src/com/android/systemui/recents/model/Task.java b/packages/SystemUI/src/com/android/systemui/recents/model/Task.java
index a0ff3b7..9da1b47 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/model/Task.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/model/Task.java
@@ -37,25 +37,33 @@
public static class TaskKey {
public final int id;
public final Intent baseIntent;
+ public final int userId;
- public TaskKey(int id, Intent intent) {
+ public TaskKey(int id, Intent intent, int userId) {
this.id = id;
this.baseIntent = intent;
+ this.userId = userId;
}
@Override
public boolean equals(Object o) {
- return hashCode() == o.hashCode();
+ if (!(o instanceof TaskKey)) {
+ return false;
+ }
+ return id == ((TaskKey) o).id
+ && userId == ((TaskKey) o).userId;
}
@Override
public int hashCode() {
- return id;
+ return (id << 5) + userId;
}
@Override
public String toString() {
- return "Task.Key: " + id + ", " + baseIntent.getComponent().getPackageName();
+ return "Task.Key: " + id + ", "
+ + "u" + userId + ", "
+ + baseIntent.getComponent().getPackageName();
}
}
@@ -71,7 +79,7 @@
public Task(int id, boolean isActive, Intent intent, String activityTitle,
Bitmap activityIcon, int userId) {
- this.key = new TaskKey(id, intent);
+ this.key = new TaskKey(id, intent, userId);
this.activityLabel = activityTitle;
this.activityIcon = activityIcon;
this.isActive = isActive;