Fixing crash when trying to set thumbnail info.

- The TaskThumbnailInfo can have the same lifecycle as the TaskRecord, and
  we should just reset it instead of setting it to null when the thumbnail
  is disposed.

Bug: 25652261
Change-Id: I54384e208b19e60d469bf3471dd555f78f04290c
This commit is contained in:
Winson
2015-11-11 18:11:59 -08:00
committed by Winson Chung
parent be2187a175
commit c6a2da07bf
2 changed files with 11 additions and 1 deletions

View File

@@ -1558,6 +1558,16 @@ public class ActivityManager {
readFromParcel(source);
}
/**
* Resets this info state to the initial state.
* @hide
*/
public void reset() {
taskWidth = 0;
taskHeight = 0;
screenOrientation = 0;
}
/** @hide */
public void saveToXml(XmlSerializer out) throws IOException {
out.attribute(null, ATTR_TASK_WIDTH, Integer.toString(taskWidth));

View File

@@ -572,8 +572,8 @@ final class TaskRecord {
* Removes all associated thumbnail data when a task is removed or pruned from recents.
*/
void disposeThumbnail() {
mLastThumbnailInfo.reset();
mLastThumbnail = null;
mLastThumbnailInfo = null;
lastDescription = null;
}