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

Commit 4c770bf2 authored by Jerry Chang's avatar Jerry Chang
Browse files

Update recent tasks order when the last resumed activity changed

Ensure to update recent tasks order when the last resumed activity
chagned to cover cases like dismissing the focused side of split screen
to the background.

Fix: 259648295
Test: atest ActivityTaskSupervisorTests
Change-Id: I9a18c35da40f13163977da47eac5c12605afabdf
parent 846ed065
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4715,6 +4715,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                mTaskChangeNotificationController.notifyTaskFocusChanged(prevTask.mTaskId, false);
            }
            mTaskChangeNotificationController.notifyTaskFocusChanged(task.mTaskId, true);
            mTaskSupervisor.mRecentTasks.add(task);
        }

        applyUpdateLockStateLocked(r);
+13 −0
Original line number Diff line number Diff line
@@ -248,6 +248,19 @@ public class ActivityTaskSupervisorTests extends WindowTestsBase {
                eq(true) /* focused */);
    }

    /**
     * Ensures it updates recent tasks order when the last resumed activity changed.
     */
    @Test
    public void testUpdateRecentTasksForTopResumed() {
        spyOn(mSupervisor.mRecentTasks);
        final ActivityRecord activity = new ActivityBuilder(mAtm).setCreateTask(true).build();
        final Task task = activity.getTask();

        mAtm.setLastResumedActivityUncheckLocked(activity, "test");
        verify(mSupervisor.mRecentTasks).add(eq(task));
    }

    /**
     * Ensures that a trusted display can launch arbitrary activity and an untrusted display can't.
     */