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
This commit is contained in:
wilsonshih
2019-05-06 09:31:02 +08:00
parent 1877e93695
commit 6164e01ee4
3 changed files with 7 additions and 5 deletions

View File

@@ -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 */

View File

@@ -321,11 +321,10 @@ final class InputMonitor {
}
void updateInputWindowsImmediately() {
if (mUpdateInputWindowsPending) {
mApplyImmediately = true;
mUpdateInputWindows.run();
mApplyImmediately = false;
}
mHandler.removeCallbacks(mUpdateInputWindows);
mApplyImmediately = true;
mUpdateInputWindows.run();
mApplyImmediately = false;
}
/* Called when the current input focus changes.

View File

@@ -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,