Fixing memory leaks related to Tasks holding onto their callbacks.
- Switching to SwipeHelper
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 9b03c5d..378984c 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/model/Task.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/model/Task.java
@@ -54,6 +54,24 @@
}
}
+ /** Notifies the callback listeners that this task has been loaded */
+ public void notifyTaskLoaded(Bitmap thumbnail, Drawable icon) {
+ this.icon = icon;
+ this.thumbnail = thumbnail;
+ if (mCb != null) {
+ mCb.onTaskBound();
+ }
+ }
+
+ /** Notifies the callback listeners that this task has been unloaded */
+ public void notifyTaskUnloaded(Bitmap defaultThumbnail, Drawable defaultIcon) {
+ icon = defaultIcon;
+ thumbnail = defaultThumbnail;
+ if (mCb != null) {
+ mCb.onTaskUnbound();
+ }
+ }
+
@Override
public boolean equals(Object o) {
// If we have multiple task entries for the same task, then we do the simple object