Skip to content

Commit de6198e

Browse files
author
Craig Mautner
committed
Defer the Surface.show until animation phase.
This fixes a rotation bug introduced by delaying rendering animation into the Surface. Now instead of delaying the rendering we delay the show by eliminating a point where we were showing the Surface too soon. Change-Id: I63ad3b494963111ffc96569093c8d43517c5408b
1 parent b7c30a8 commit de6198e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

services/java/com/android/server/wm/WindowStateAnimator.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ public void prepareSurfaceLocked(final boolean recoveringMemory) {
978978

979979
setSurfaceBoundaries(recoveringMemory);
980980

981-
if (w.mAttachedHidden || !w.isReadyForDisplay() || !w.isDrawnLw()) {
981+
if (w.mAttachedHidden || !w.isReadyForDisplay()) {
982982
if (!mLastHidden) {
983983
//dump();
984984
mLastHidden = true;
@@ -1136,17 +1136,15 @@ boolean performShowLocked() {
11361136
+ " animating=" + mAnimating
11371137
+ " tok animating="
11381138
+ (mWin.mAppToken != null ? mWin.mAppToken.mAppAnimator.animating : false));
1139-
if (!showSurfaceRobustlyLocked()) {
1140-
return false;
1141-
}
11421139

11431140
mService.enableScreenIfNeededLocked();
11441141

11451142
applyEnterAnimationLocked();
11461143

1144+
// Force the show in the next prepareSurfaceLocked() call.
11471145
mLastAlpha = -1;
1148-
mLastHidden = false;
11491146
mDrawState = HAS_DRAWN;
1147+
mService.scheduleAnimationLocked();
11501148

11511149
int i = mWin.mChildWindows.size();
11521150
while (i > 0) {

0 commit comments

Comments
 (0)