diff options
author | Craig Mautner <cmautner@google.com> | 2012-03-29 18:00:19 -0700 |
---|---|---|
committer | Craig Mautner <cmautner@google.com> | 2012-03-29 18:00:19 -0700 |
commit | d87946ba48b62a6a83fd971ef7c4c419407db836 (patch) | |
tree | ff03729c7e9364af1911f726c1fbf82cded90ea0 | |
parent | 1505ce29cfa62665cc645c319ecc7c288eb078cc (diff) | |
download | frameworks_base-d87946ba48b62a6a83fd971ef7c4c419407db836.zip frameworks_base-d87946ba48b62a6a83fd971ef7c4c419407db836.tar.gz frameworks_base-d87946ba48b62a6a83fd971ef7c4c419407db836.tar.bz2 |
Remove obsolete variable masking valid one.
The mUpdateRotation variable was still in the WindowManagerService
mInnerFields object. This was masking the true mUpdateRotation found in
WindowAnimator.
Fixes Bug 6240025.
Change-Id: I6531002f870f30d22e19ba9af5cac86e1c7b9bcb
3 files changed, 33 insertions, 32 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index a1b7967..58505bd 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -600,7 +600,6 @@ public class WindowManagerService extends IWindowManager.Stub private boolean mSyswin = false; private float mScreenBrightness = -1; private float mButtonBrightness = -1; - private boolean mUpdateRotation = false; } LayoutAndSurfaceFields mInnerFields = new LayoutAndSurfaceFields(); @@ -8575,17 +8574,17 @@ public class WindowManagerService extends IWindowManager.Stub mTurnOnScreen = false; } - if (mInnerFields.mUpdateRotation) { + if (mAnimator.mUpdateRotation) { if (DEBUG_ORIENTATION) Slog.d(TAG, "Performing post-rotate rotation"); if (updateRotationUncheckedLocked(false)) { mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION); } else { - mInnerFields.mUpdateRotation = false; + mAnimator.mUpdateRotation = false; } } if (mInnerFields.mOrientationChangeComplete && !mLayoutNeeded && - !mInnerFields.mUpdateRotation) { + !mAnimator.mUpdateRotation) { checkDrawnWindowsLocked(); } @@ -8924,11 +8923,11 @@ public class WindowManagerService extends IWindowManager.Stub mAnimator.mScreenRotationAnimation.kill(); mAnimator.mScreenRotationAnimation = null; } - if (mAnimator.mScreenRotationAnimation == null) { - mAnimator.mScreenRotationAnimation = new ScreenRotationAnimation(mContext, - mFxSession, inTransaction, mCurDisplayWidth, mCurDisplayHeight, - mDisplay.getRotation()); - } + + mAnimator.mScreenRotationAnimation = new ScreenRotationAnimation(mContext, + mFxSession, inTransaction, mCurDisplayWidth, mCurDisplayHeight, + mDisplay.getRotation()); + if (!mAnimator.mScreenRotationAnimation.hasScreenshot()) { Surface.freezeDisplay(0); } @@ -8943,6 +8942,10 @@ public class WindowManagerService extends IWindowManager.Stub } if (mWaitingForConfig || mAppsFreezingScreen > 0 || mWindowsFreezingScreen) { + if (DEBUG_ORIENTATION) Slog.d(TAG, + "stopFreezingDisplayLocked: Returning mWaitingForConfig=" + mWaitingForConfig + + ", mAppsFreezingScreen=" + mAppsFreezingScreen + + ", mWindowsFreezingScreen=" + mWindowsFreezingScreen); return; } diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java index 789bfaa..d22b17c 100644 --- a/services/java/com/android/server/wm/WindowState.java +++ b/services/java/com/android/server/wm/WindowState.java @@ -24,8 +24,6 @@ import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD; import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; -import com.android.server.wm.WindowManagerService.H; - import android.content.Context; import android.content.res.Configuration; import android.graphics.Matrix; @@ -40,15 +38,10 @@ import android.view.Gravity; import android.view.IApplicationToken; import android.view.IWindow; import android.view.InputChannel; -import android.view.Surface; import android.view.View; import android.view.ViewTreeObserver; import android.view.WindowManager; import android.view.WindowManagerPolicy; -import android.view.WindowManager.LayoutParams; -import android.view.animation.Animation; -import android.view.animation.AnimationUtils; -import android.view.animation.Transformation; import java.io.PrintWriter; import java.util.ArrayList; @@ -57,6 +50,8 @@ import java.util.ArrayList; * A window in the window manager. */ final class WindowState implements WindowManagerPolicy.WindowState { + static final String TAG = "WindowState"; + static final boolean DEBUG_VISIBILITY = WindowManagerService.DEBUG_VISIBILITY; static final boolean SHOW_TRANSACTIONS = WindowManagerService.SHOW_TRANSACTIONS; static final boolean SHOW_LIGHT_TRANSACTIONS = WindowManagerService.SHOW_LIGHT_TRANSACTIONS; @@ -276,7 +271,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { mSeq = seq; mEnforceSizeCompat = (mAttrs.flags & FLAG_COMPATIBLE_WINDOW) != 0; if (WindowManagerService.localLOGV) Slog.v( - WindowManagerService.TAG, "Window " + this + " client=" + c.asBinder() + TAG, "Window " + this + " client=" + c.asBinder() + " token=" + token + " (" + mAttrs.token + ")"); try { c.asBinder().linkToDeath(deathRecipient, 0); @@ -304,7 +299,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { + WindowManagerService.TYPE_LAYER_OFFSET; mSubLayer = mPolicy.subWindowTypeToLayerLw(a.type); mAttachedWindow = attachedWindow; - if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(WindowManagerService.TAG, "Adding " + this + " to " + mAttachedWindow); + if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + this + " to " + mAttachedWindow); mAttachedWindow.mChildWindows.add(this); mLayoutAttached = mAttrs.type != WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG; @@ -358,7 +353,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { void attach() { if (WindowManagerService.localLOGV) Slog.v( - WindowManagerService.TAG, "Attaching " + this + " token=" + mToken + TAG, "Attaching " + this + " token=" + mToken + ", list=" + mToken.windows); mSession.windowAddedLocked(); } @@ -496,7 +491,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { if (WindowManagerService.localLOGV) { //if ("com.google.android.youtube".equals(mAttrs.packageName) // && mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_PANEL) { - Slog.v(WindowManagerService.TAG, "Resolving (mRequestedWidth=" + Slog.v(TAG, "Resolving (mRequestedWidth=" + mRequestedWidth + ", mRequestedheight=" + mRequestedHeight + ") to" + " (pw=" + pw + ", ph=" + ph + "): frame=" + mFrame.toShortString() @@ -600,10 +595,11 @@ final class WindowState implements WindowManagerPolicy.WindowState { return mAppToken != null ? mAppToken.firstWindowDrawn : false; } + // TODO(cmautner): Move to WindowStateAnimator boolean finishDrawingLocked() { if (mDrawPending) { if (SHOW_TRANSACTIONS || WindowManagerService.DEBUG_ORIENTATION) Slog.v( - WindowManagerService.TAG, "finishDrawingLocked: " + this + " in " + TAG, "finishDrawingLocked: " + this + " in " + mWinAnimator.mSurface); mCommitDrawPending = true; mDrawPending = false; @@ -612,6 +608,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { return false; } + // TODO(cmautner): Move to WindowStateAnimator // This must be called while inside a transaction. boolean commitFinishDrawingLocked(long currentTime) { //Slog.i(TAG, "commitFinishDrawingLocked: " + mSurface); @@ -820,7 +817,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { disposeInputChannel(); if (mAttachedWindow != null) { - if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(WindowManagerService.TAG, "Removing " + this + " from " + mAttachedWindow); + if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(TAG, "Removing " + this + " from " + mAttachedWindow); mAttachedWindow.mChildWindows.remove(this); } mWinAnimator.destroyDeferredSurfaceLocked(); @@ -859,7 +856,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { try { synchronized(mService.mWindowMap) { WindowState win = mService.windowForClientLocked(mSession, mClient, false); - Slog.i(WindowManagerService.TAG, "WIN DEATH: " + win); + Slog.i(TAG, "WIN DEATH: " + win); if (win != null) { mService.removeWindowLocked(mSession, win); } @@ -891,9 +888,9 @@ final class WindowState implements WindowManagerPolicy.WindowState { // Already showing. return false; } - if (DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "Policy visibility true: " + this); + if (DEBUG_VISIBILITY) Slog.v(TAG, "Policy visibility true: " + this); if (doAnimation) { - if (DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "doAnimation: mPolicyVisibility=" + if (DEBUG_VISIBILITY) Slog.v(TAG, "doAnimation: mPolicyVisibility=" + mPolicyVisibility + " mAnimation=" + mWinAnimator.mAnimation); if (!mService.okToDisplay()) { doAnimation = false; @@ -940,7 +937,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { if (doAnimation) { mPolicyVisibilityAfterAnim = false; } else { - if (DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "Policy visibility false: " + this); + if (DEBUG_VISIBILITY) Slog.v(TAG, "Policy visibility false: " + this); mPolicyVisibilityAfterAnim = false; mPolicyVisibility = false; // Window is no longer visible -- make sure if we were waiting diff --git a/services/java/com/android/server/wm/WindowStateAnimator.java b/services/java/com/android/server/wm/WindowStateAnimator.java index 789e74b..d1539ba 100644 --- a/services/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/java/com/android/server/wm/WindowStateAnimator.java @@ -554,7 +554,7 @@ class WindowStateAnimator { mPendingDestroySurface.destroy(); } } catch (RuntimeException e) { - Slog.w(WindowManagerService.TAG, "Exception thrown when destroying Window " + Slog.w(TAG, "Exception thrown when destroying Window " + this + " surface " + mPendingDestroySurface + " session " + mSession + ": " + e.toString()); } @@ -705,6 +705,7 @@ class WindowStateAnimator { mDsDy = 0; mDtDy = mWin.mGlobalScale; } + public void prepareSurfaceLocked(final boolean recoveringMemory) { final WindowState w = mWin; if (mSurface == null) { @@ -892,7 +893,7 @@ class WindowStateAnimator { e = new RuntimeException(); e.fillInStackTrace(); } - Slog.v(WindowManagerService.TAG, "performShow on " + this + Slog.v(TAG, "performShow on " + this + ": readyToShow=" + mWin.mReadyToShow + " readyForDisplay=" + mWin.isReadyForDisplay() + " starting=" + (mWin.mAttrs.type == TYPE_APPLICATION_STARTING), e); @@ -900,7 +901,7 @@ class WindowStateAnimator { if (mWin.mReadyToShow && mWin.isReadyForDisplay()) { if (SHOW_TRANSACTIONS || WindowManagerService.DEBUG_ORIENTATION) WindowManagerService.logSurface(mWin, "SHOW (performShowLocked)", null); - if (DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "Showing " + this + if (DEBUG_VISIBILITY) Slog.v(TAG, "Showing " + this + " during animation: policyVis=" + mWin.mPolicyVisibility + " attHidden=" + mWin.mAttachedHidden + " tok.hiddenRequested=" @@ -947,7 +948,7 @@ class WindowStateAnimator { if (mWin.mAppToken.startingData != null) { if (WindowManagerService.DEBUG_STARTING_WINDOW || - WindowManagerService.DEBUG_ANIM) Slog.v(WindowManagerService.TAG, + WindowManagerService.DEBUG_ANIM) Slog.v(TAG, "Finish starting " + mWin.mToken + ": first real window is shown, no animation"); // If this initial window is animating, stop it -- we @@ -1059,7 +1060,7 @@ class WindowStateAnimator { a = mService.loadAnimation(mWin.mAttrs, attr); } } - if (WindowManagerService.DEBUG_ANIM) Slog.v(WindowManagerService.TAG, + if (WindowManagerService.DEBUG_ANIM) Slog.v(TAG, "applyAnimation: win=" + this + " anim=" + anim + " attr=0x" + Integer.toHexString(attr) + " mAnimation=" + mAnimation @@ -1071,7 +1072,7 @@ class WindowStateAnimator { e = new RuntimeException(); e.fillInStackTrace(); } - Slog.v(WindowManagerService.TAG, "Loaded animation " + a + " for " + this, e); + Slog.v(TAG, "Loaded animation " + a + " for " + this, e); } setAnimation(a); mAnimationIsEntrance = isEntrance; |