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

Commit eccd6e40 authored by Winston Hung's avatar Winston Hung Committed by Winson Chung
Browse files

Fix crash caused by accessing finishing task

In our design, there are two existing recents task at the same time. If
start new recents while finishing previous recents, there are two subtasks under recents root task, one is newly created and the other
is finishing subtask. Try to get activity from finishing subtask would
be null and cause NPE when manipulate null activity.

Append non-finishing check could ensure we get activity record from
newly created subtask instead of finishing subtask.

Test: atest CtsWindowManagerDeviceTestCases

Change-Id: I3fe8357e57c4f1afe578c696e8371874be0ed45e
parent e2137ed5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -520,7 +520,7 @@ class RecentsAnimation implements RecentsAnimationCallbacks, OnRootTaskOrderChan
    }

    private boolean matchesTarget(Task task) {
        return task.mUserId == mUserId
        return task.getNonFinishingActivityCount() > 0 && task.mUserId == mUserId
                && task.getBaseIntent().getComponent().equals(mTargetIntent.getComponent());
    }
}