Merge "Do not set orientation changing to invisible window" into tm-qpr-dev
This commit is contained in:
@@ -6007,7 +6007,11 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
if (mFrozenDisplayId != INVALID_DISPLAY && mFrozenDisplayId == w.getDisplayId()
|
if (mFrozenDisplayId != INVALID_DISPLAY && mFrozenDisplayId == w.getDisplayId()
|
||||||
&& mWindowsFreezingScreen != WINDOWS_FREEZING_SCREENS_TIMEOUT) {
|
&& mWindowsFreezingScreen != WINDOWS_FREEZING_SCREENS_TIMEOUT) {
|
||||||
ProtoLog.v(WM_DEBUG_ORIENTATION, "Changing surface while display frozen: %s", w);
|
ProtoLog.v(WM_DEBUG_ORIENTATION, "Changing surface while display frozen: %s", w);
|
||||||
|
// WindowsState#reportResized won't tell invisible requested window to redraw,
|
||||||
|
// so do not set it as changing orientation to avoid affecting draw state.
|
||||||
|
if (w.isVisibleRequested()) {
|
||||||
w.setOrientationChanging(true);
|
w.setOrientationChanging(true);
|
||||||
|
}
|
||||||
if (mWindowsFreezingScreen == WINDOWS_FREEZING_SCREENS_NONE) {
|
if (mWindowsFreezingScreen == WINDOWS_FREEZING_SCREENS_NONE) {
|
||||||
mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_ACTIVE;
|
mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_ACTIVE;
|
||||||
// XXX should probably keep timeout from
|
// XXX should probably keep timeout from
|
||||||
|
|||||||
@@ -731,6 +731,15 @@ public class WindowStateTests extends WindowTestsBase {
|
|||||||
assertTrue(mWm.mResizingWindows.contains(startingApp));
|
assertTrue(mWm.mResizingWindows.contains(startingApp));
|
||||||
assertTrue(startingApp.isDrawn());
|
assertTrue(startingApp.isDrawn());
|
||||||
assertFalse(startingApp.getOrientationChanging());
|
assertFalse(startingApp.getOrientationChanging());
|
||||||
|
|
||||||
|
// Even if the display is frozen, invisible requested window should not be affected.
|
||||||
|
startingApp.mActivityRecord.mVisibleRequested = false;
|
||||||
|
mWm.startFreezingDisplay(0, 0, mDisplayContent);
|
||||||
|
doReturn(true).when(mWm.mPolicy).isScreenOn();
|
||||||
|
startingApp.getWindowFrames().setInsetsChanged(true);
|
||||||
|
startingApp.updateResizingWindowIfNeeded();
|
||||||
|
assertTrue(startingApp.isDrawn());
|
||||||
|
assertFalse(startingApp.getOrientationChanging());
|
||||||
}
|
}
|
||||||
|
|
||||||
@UseTestDisplay(addWindows = W_ABOVE_ACTIVITY)
|
@UseTestDisplay(addWindows = W_ABOVE_ACTIVITY)
|
||||||
|
|||||||
Reference in New Issue
Block a user