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

Commit d58d7b3e authored by Bryce Lee's avatar Bryce Lee Committed by Andrew Zeng
Browse files

Inform WindowManager when Activity is reordered to front.

This event was captured on the ActivityManager side through
TaskRecord::moveActivityToFrontLocked. However, this change was
not conveyed to the WindowManager, leading to potential issues, such
as sending key events to the wrong Activity.

Change-Id: Ia5cf3dc0f2dac8fa10adc775c2ebb08beee0c064
Fixes: 65031003
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerActivityVisibilityTests#testReorderToFrontBackstack
(cherry picked from commit c033f8de620db59ff94ef905a4ab66ac3e212c06)
parent a891ca5f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1139,6 +1139,9 @@ class TaskRecord extends ConfigurationContainer implements TaskWindowContainerLi

        mActivities.remove(newTop);
        mActivities.add(newTop);

        // Make sure window manager is aware of the position change.
        mWindowContainerController.positionChildAtTop(newTop.mWindowContainerController);
        updateEffectiveIntent();

        setFrontOfTask();
+4 −0
Original line number Diff line number Diff line
@@ -103,6 +103,10 @@ public class TaskWindowContainerController
        }
    }

    public void positionChildAtTop(AppWindowContainerController childController) {
        positionChildAt(childController, POSITION_TOP);
    }

    public void positionChildAt(AppWindowContainerController childController, int position) {
        synchronized(mService.mWindowMap) {
            final AppWindowToken aToken = childController.mContainer;