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

Commit aa86e8bd authored by Louis Chang's avatar Louis Chang Committed by Automerger Merge Worker
Browse files

Merge "Fix returning activity that not in the task" into rvc-dev am:...

Merge "Fix returning activity that not in the task" into rvc-dev am: 3799331c am: 0871ed34 am: 132b7671 am: 5f529246

Change-Id: Ib520e1768bff2e4f275665c5d2496de64de3f94a
parents b143b507 5f529246
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -3758,11 +3758,7 @@ class Task extends WindowContainer<WindowContainer> {
        if (r == null) {
            return null;
        }
        final Task task = r.getRootTask();
        if (task != null && r.isDescendantOf(task)) {
            if (task != this) Slog.w(TAG, "Illegal state! task does not point to stack it is in. "
                    + "stack=" + this + " task=" + task + " r=" + r
                    + " callers=" + Debug.getCallers(15, "\n"));
        if (r.isDescendantOf(this)) {
            return r;
        }
        return null;
+12 −0
Original line number Diff line number Diff line
@@ -146,4 +146,16 @@ public class TaskTests extends WindowTestsBase {
        task.setBounds(bounds);
        assertEquals(new Point(bounds.left, bounds.top), task.getLastSurfacePosition());
    }

    @Test
    public void testIsInStack() {
        final Task task1 = createTaskStackOnDisplay(mDisplayContent);
        final Task task2 = createTaskStackOnDisplay(mDisplayContent);
        final ActivityRecord activity1 =
                WindowTestUtils.createActivityRecordInTask(mDisplayContent, task1);
        final ActivityRecord activity2 =
                WindowTestUtils.createActivityRecordInTask(mDisplayContent, task2);
        assertEquals(activity1, task1.isInTask(activity1));
        assertNull(task1.isInTask(activity2));
    }
}