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

Commit 4cdd52df authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[AE] Fix focus due to explicitly setting adjacent activity resumed" into main

parents 155437bb 0b745e5b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -665,9 +665,11 @@ class TaskFragment extends WindowContainer<WindowContainer> {
        mResumedActivity = r;
        final ActivityRecord topResumed = mTaskSupervisor.updateTopResumedActivityIfNeeded(reason);
        if (mResumedActivity != null && topResumed != null && topResumed.isEmbedded()
                && topResumed.getTaskFragment().isAdjacentTo(this)) {
                && topResumed.getTaskFragment().isAdjacentTo(this)
                && topResumed.getTaskFragment().isPinned()) {
            // Explicitly updates the last resumed Activity if the resumed activity is
            // adjacent to the top-resumed embedded activity.
            // adjacent to the top-resumed embedded activity and the top-resumed TaskFragment is
            // pinned.
            mAtmService.setLastResumedActivityUncheckLocked(mResumedActivity, reason);
        }
        if (r == null && prevR.mDisplayContent != null
+2 −2
Original line number Diff line number Diff line
@@ -1235,9 +1235,9 @@ public class TaskFragmentTest extends WindowTestsBase {
        taskFragmentRight.setResumedActivity(appRightTop, "test");
        assertEquals(appRightTop, task.getDisplayContent().mFocusedApp);

        // Ensure the focused app is updated when the left activity resumed.
        // Ensure the focused app is NOT updated when the left activity resumed.
        taskFragmentLeft.setResumedActivity(appLeftTop, "test");
        assertEquals(appLeftTop, task.getDisplayContent().mFocusedApp);
        assertEquals(appRightTop, task.getDisplayContent().mFocusedApp);
    }

    @Test