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

Commit 6164e01e authored by wilsonshih's avatar wilsonshih
Browse files

Write top focused display ID in WindowManagerServiceDumpProto.

Sometimes the focus display is not updated during test because the
inject event between two displays may be too fast, the input window
info may not been applied to InputFlinger yet before second inject
event.
Add top focused display ID in proto so test cases can monitor this.

Bug: 127741025
Bug: 135104079

Test: stress test on
ActivityLifecycleTopResumedStateTests#testTopPositionSwitchAcrossDisplaysOnTap
Also enable DEBUG_FOCUS in InputFlinger and check log to make sure the input
window is updated during tapOnDisplayCenter.

Test: atest WindowInsetsBehaviorTests MultiDisplayPolicyTests
MultiDisplaySystemDecorationTests ActivityLifecycleTopResumedStateTests
Test: atest MultiDisplayKeyguardTests MultiDisplayLockedKeyguardTests

Change-Id: Ie7ca9645553aaa48077a8ccae9a4376cc7d2e0f6
parent 1877e936
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ message WindowManagerServiceDumpProto {
    optional bool display_frozen = 6;
    optional int32 rotation = 7;
    optional int32 last_orientation = 8;
    optional int32 focused_display_id = 9;
}

/* represents RootWindowContainer object */
+4 −5
Original line number Diff line number Diff line
@@ -321,12 +321,11 @@ final class InputMonitor {
    }

    void updateInputWindowsImmediately() {
        if (mUpdateInputWindowsPending) {
        mHandler.removeCallbacks(mUpdateInputWindows);
        mApplyImmediately = true;
        mUpdateInputWindows.run();
        mApplyImmediately = false;
    }
    }

    /* Called when the current input focus changes.
     * Layer assignment is assumed to be complete by the time this is called.
+2 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerServiceDumpProto.DISPLAY_FROZEN;
import static com.android.server.wm.WindowManagerServiceDumpProto.FOCUSED_APP;
import static com.android.server.wm.WindowManagerServiceDumpProto.FOCUSED_DISPLAY_ID;
import static com.android.server.wm.WindowManagerServiceDumpProto.FOCUSED_WINDOW;
import static com.android.server.wm.WindowManagerServiceDumpProto.INPUT_METHOD_WINDOW;
import static com.android.server.wm.WindowManagerServiceDumpProto.LAST_ORIENTATION;
@@ -5929,6 +5930,7 @@ public class WindowManagerService extends IWindowManager.Stub
        final DisplayContent defaultDisplayContent = getDefaultDisplayContentLocked();
        proto.write(ROTATION, defaultDisplayContent.getRotation());
        proto.write(LAST_ORIENTATION, defaultDisplayContent.getLastOrientation());
        proto.write(FOCUSED_DISPLAY_ID, topFocusedDisplayContent.getDisplayId());
    }

    private void dumpWindowsLocked(PrintWriter pw, boolean dumpAll,