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

Commit 1e5b10a2 authored by Tiger Huang's avatar Tiger Huang
Browse files

Track focus changes on external displays (2/4)

Let each DisplayContent has its own focused window and focused app.
This change also moves the last tapped display to the top.

Test: atest ActivityManagerMultiDisplayTests
            ActivityStackSupervisorTests
            ActivityStackTests
            CtsWindowManagerDeviceTestCases
            DisplayContentTests
            PointerCaptureTest
Bug: 111361570
Change-Id: I776cabaeaf41ff4240f504fb1430d3e40892023d
parent 4af85a3e
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -87,7 +87,6 @@ interface IWindowManager
    void setEventDispatching(boolean enabled);
    void addWindowToken(IBinder token, int type, int displayId);
    void removeWindowToken(IBinder token, int displayId);
    void setFocusedApp(IBinder token, boolean moveFocusNow);
    void prepareAppTransition(int transit, boolean alwaysKeepCurrent);
    int getPendingAppTransition();
    void overridePendingAppTransition(String packageName, int enterAnim, int exitAnim,
+1 −0
Original line number Diff line number Diff line
@@ -158,6 +158,7 @@ message DisplayContentProto {
    optional ScreenRotationAnimationProto screen_rotation_animation = 12;
    optional DisplayFramesProto display_frames = 13;
    optional int32 surface_size = 14;
    optional string focused_app = 15;
}

/* represents DisplayFrames */
+1 −1
Original line number Diff line number Diff line
@@ -2254,8 +2254,8 @@ HPLcom/android/server/wm/DisplayContent;->lambda$new$7(Lcom/android/server/wm/Di
HPLcom/android/server/wm/DisplayContent;->lambda$new$8(Lcom/android/server/wm/DisplayContent;Lcom/android/server/wm/WindowState;)V
HPLcom/android/server/wm/DisplayContent;->prepareSurfaces()V
HPLcom/android/server/wm/DisplayContent;->resetAnimationBackgroundAnimator()V
HPLcom/android/server/wm/DisplayContent;->setTouchExcludeRegion(Lcom/android/server/wm/Task;)V
HPLcom/android/server/wm/DisplayContent;->skipTraverseChild(Lcom/android/server/wm/WindowContainer;)Z
HPLcom/android/server/wm/DisplayContent;->updateTouchExcludeRegion()V
HPLcom/android/server/wm/DockedStackDividerController;->isResizing()Z
HPLcom/android/server/wm/DragDropController;->dragDropActiveLocked()Z
HPLcom/android/server/wm/InputMonitor$UpdateInputForAllWindowsConsumer;->accept(Lcom/android/server/wm/WindowState;)V
+4 −0
Original line number Diff line number Diff line
@@ -920,6 +920,10 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack>
                && (mSupervisor.mService.mRunningVoice == null);
    }

    void setFocusedApp(ActivityRecord r, boolean moveFocusNow) {
        mWindowContainerController.setFocusedApp(r.appToken, moveFocusNow);
    }

    /**
     * @return the stack currently above the {@param stack}.  Can be null if the {@param stack} is
     *         already top-most.
+1 −1
Original line number Diff line number Diff line
@@ -5434,7 +5434,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai

        // Do not sleep activities in this stack if we're marked as focused and the keyguard
        // is in the process of going away.
        if (mStackSupervisor.getTopDisplayFocusedStack() == this
        if (isFocusedStackOnDisplay()
                && mStackSupervisor.getKeyguardController().isKeyguardGoingAway()) {
            return false;
        }
Loading