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

Commit c6a2da07 authored by Winson's avatar Winson Committed by Winson Chung
Browse files

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
parent be2187a1
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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));
+1 −1
Original line number Diff line number Diff line
@@ -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;
    }