Merge "Ignore "mLastHidden" state when deciding whether to turnScreenOn." into oc-dr1-dev

This commit is contained in:
TreeHugger Robot
2017-07-24 20:04:02 +00:00
committed by Android (Google) Code Review

View File

@@ -1604,7 +1604,8 @@ class WindowStateAnimator {
recoveringMemory); recoveringMemory);
mSurfaceController.setLayer(mAnimLayer); mSurfaceController.setLayer(mAnimLayer);
if (prepared && mLastHidden && mDrawState == HAS_DRAWN) { if (prepared && mDrawState == HAS_DRAWN) {
if (mLastHidden) {
if (showSurfaceRobustlyLocked()) { if (showSurfaceRobustlyLocked()) {
markPreservedSurfaceForDestroy(); markPreservedSurfaceForDestroy();
mAnimator.requestRemovalOfReplacedWindows(w); mAnimator.requestRemovalOfReplacedWindows(w);
@@ -1621,6 +1622,17 @@ class WindowStateAnimator {
w.setOrientationChanging(false); w.setOrientationChanging(false);
} }
} }
// We process mTurnOnScreen even for windows which have already
// been shown, to handle cases where windows are not necessarily
// hidden while the screen is turning off.
// TODO(b/63773439): These cases should be eliminated, though we probably still
// want to process mTurnOnScreen in this way for clarity.
if (mWin.mTurnOnScreen) {
if (DEBUG_VISIBILITY) Slog.v(TAG, "Show surface turning screen on: " + mWin);
mWin.mTurnOnScreen = false;
mAnimator.mBulkUpdateParams |= SET_TURN_ON_SCREEN;
}
}
if (hasSurface()) { if (hasSurface()) {
w.mToken.hasVisible = true; w.mToken.hasVisible = true;
} }
@@ -1730,11 +1742,6 @@ class WindowStateAnimator {
if (!shown) if (!shown)
return false; return false;
if (mWin.mTurnOnScreen) {
if (DEBUG_VISIBILITY) Slog.v(TAG, "Show surface turning screen on: " + mWin);
mWin.mTurnOnScreen = false;
mAnimator.mBulkUpdateParams |= SET_TURN_ON_SCREEN;
}
return true; return true;
} }