Merge "Only reset layout seq when moved to a new display." into qt-dev am: cee859e26e

am: a2b9d58dcb

Change-Id: I53cdf061a69b2df365e31cbf00fbe0f25fa8ef09
This commit is contained in:
Garfield Tan
2019-04-16 10:50:29 -07:00
committed by android-build-merger
2 changed files with 4 additions and 2 deletions

View File

@@ -1305,7 +1305,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
void onDisplayChanged(DisplayContent dc) {
super.onDisplayChanged(dc);
// Window was not laid out for this display yet, so make sure mLayoutSeq does not match.
if (dc != null) {
if (dc != null && mInputWindowHandle.displayId != dc.getDisplayId()) {
mLayoutSeq = dc.mLayoutSeq - 1;
mInputWindowHandle.displayId = dc.getDisplayId();
}

View File

@@ -397,7 +397,9 @@ public class WindowStateTests extends WindowTestsBase {
app.mLayoutSeq = 1;
mDisplayContent.mLayoutSeq = 1;
app.onDisplayChanged(mDisplayContent);
DisplayContent newDisplay = createNewDisplay();
app.onDisplayChanged(newDisplay);
assertThat(app.mLayoutSeq, not(is(mDisplayContent.mLayoutSeq)));
}