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
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user