Use Task last active time to ensure we don't reload items for the cache.
Change-Id: I29206de0453f5d7d1370b27a27ef6d3594eff8e7
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 f366ef0..cba9e5a 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/model/Task.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/model/Task.java
@@ -16,7 +16,6 @@
package com.android.systemui.recents.model;
-import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
@@ -40,11 +39,17 @@
public final int id;
public final Intent baseIntent;
public final int userId;
+ public long lastActiveTime;
- public TaskKey(int id, Intent intent, int userId) {
+ public TaskKey(int id, Intent intent, int userId, long lastActiveTime) {
this.id = id;
this.baseIntent = intent;
this.userId = userId;
+ this.lastActiveTime = lastActiveTime;
+ }
+
+ public void updateLastActiveTime(long lastActiveTime) {
+ this.lastActiveTime = lastActiveTime;
}
@Override
@@ -64,7 +69,8 @@
@Override
public String toString() {
return "Task.Key: " + id + ", "
- + "u" + userId + ", "
+ + "u: " + userId + ", "
+ + "lat: " + lastActiveTime + ", "
+ baseIntent.getComponent().getPackageName();
}
}
@@ -85,8 +91,8 @@
}
public Task(int id, boolean isActive, Intent intent, String activityTitle,
- BitmapDrawable activityIcon, int colorPrimary, int userId) {
- this.key = new TaskKey(id, intent, userId);
+ BitmapDrawable activityIcon, int colorPrimary, int userId, long lastActiveTime) {
+ this.key = new TaskKey(id, intent, userId, lastActiveTime);
this.activityLabel = activityTitle;
this.activityIcon = activityIcon;
this.colorPrimary = colorPrimary;