Merge "Do not set orientation changing just for screen off" into tm-qpr-dev
This commit is contained in:
@@ -1020,7 +1020,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
private int mExitAnimId, mEnterAnimId;
|
private int mExitAnimId, mEnterAnimId;
|
||||||
|
|
||||||
/** The display that the rotation animation is applying to. */
|
/** The display that the rotation animation is applying to. */
|
||||||
private int mFrozenDisplayId;
|
private int mFrozenDisplayId = INVALID_DISPLAY;
|
||||||
|
|
||||||
/** Skip repeated ActivityRecords initialization. Note that AppWindowsToken's version of this
|
/** Skip repeated ActivityRecords initialization. Note that AppWindowsToken's version of this
|
||||||
* is a long initialized to Long.MIN_VALUE so that it doesn't match this value on startup. */
|
* is a long initialized to Long.MIN_VALUE so that it doesn't match this value on startup. */
|
||||||
@@ -5968,10 +5968,10 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
void makeWindowFreezingScreenIfNeededLocked(WindowState w) {
|
void makeWindowFreezingScreenIfNeededLocked(WindowState w) {
|
||||||
// If the screen is currently frozen or off, then keep
|
// If the screen is currently frozen, then keep it frozen until this window draws at its
|
||||||
// it frozen/off until this window draws at its new
|
// new orientation.
|
||||||
// orientation.
|
if (mFrozenDisplayId != INVALID_DISPLAY && mFrozenDisplayId == w.getDisplayId()
|
||||||
if (!w.mToken.okToDisplay() && 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);
|
||||||
w.setOrientationChanging(true);
|
w.setOrientationChanging(true);
|
||||||
if (mWindowsFreezingScreen == WINDOWS_FREEZING_SCREENS_NONE) {
|
if (mWindowsFreezingScreen == WINDOWS_FREEZING_SCREENS_NONE) {
|
||||||
|
|||||||
@@ -720,6 +720,17 @@ public class WindowStateTests extends WindowTestsBase {
|
|||||||
outWaitingForDrawn.clear();
|
outWaitingForDrawn.clear();
|
||||||
invisibleApp.requestDrawIfNeeded(outWaitingForDrawn);
|
invisibleApp.requestDrawIfNeeded(outWaitingForDrawn);
|
||||||
assertTrue(outWaitingForDrawn.isEmpty());
|
assertTrue(outWaitingForDrawn.isEmpty());
|
||||||
|
|
||||||
|
// Drawn state should not be changed for insets change when screen is off.
|
||||||
|
spyOn(mWm.mPolicy);
|
||||||
|
doReturn(false).when(mWm.mPolicy).isScreenOn();
|
||||||
|
makeWindowVisibleAndDrawn(startingApp);
|
||||||
|
startingApp.getConfiguration().orientation = 0; // Reset to be the same as last reported.
|
||||||
|
startingApp.getWindowFrames().setInsetsChanged(true);
|
||||||
|
startingApp.updateResizingWindowIfNeeded();
|
||||||
|
assertTrue(mWm.mResizingWindows.contains(startingApp));
|
||||||
|
assertTrue(startingApp.isDrawn());
|
||||||
|
assertFalse(startingApp.getOrientationChanging());
|
||||||
}
|
}
|
||||||
|
|
||||||
@UseTestDisplay(addWindows = W_ABOVE_ACTIVITY)
|
@UseTestDisplay(addWindows = W_ABOVE_ACTIVITY)
|
||||||
|
|||||||
Reference in New Issue
Block a user