Skip to content

Commit d87946b

Browse files
author
Craig Mautner
committed
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
1 parent 1505ce2 commit d87946b

File tree

3 files changed

+33
-32
lines changed

3 files changed

+33
-32
lines changed

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ class LayoutAndSurfaceFields {
600600
private boolean mSyswin = false;
601601
private float mScreenBrightness = -1;
602602
private float mButtonBrightness = -1;
603-
private boolean mUpdateRotation = false;
604603
}
605604
LayoutAndSurfaceFields mInnerFields = new LayoutAndSurfaceFields();
606605

@@ -8575,17 +8574,17 @@ private final void performLayoutAndPlaceSurfacesLockedInner(
85758574
mTurnOnScreen = false;
85768575
}
85778576

8578-
if (mInnerFields.mUpdateRotation) {
8577+
if (mAnimator.mUpdateRotation) {
85798578
if (DEBUG_ORIENTATION) Slog.d(TAG, "Performing post-rotate rotation");
85808579
if (updateRotationUncheckedLocked(false)) {
85818580
mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
85828581
} else {
8583-
mInnerFields.mUpdateRotation = false;
8582+
mAnimator.mUpdateRotation = false;
85848583
}
85858584
}
85868585

85878586
if (mInnerFields.mOrientationChangeComplete && !mLayoutNeeded &&
8588-
!mInnerFields.mUpdateRotation) {
8587+
!mAnimator.mUpdateRotation) {
85898588
checkDrawnWindowsLocked();
85908589
}
85918590

@@ -8924,11 +8923,11 @@ private void startFreezingDisplayLocked(boolean inTransaction) {
89248923
mAnimator.mScreenRotationAnimation.kill();
89258924
mAnimator.mScreenRotationAnimation = null;
89268925
}
8927-
if (mAnimator.mScreenRotationAnimation == null) {
8928-
mAnimator.mScreenRotationAnimation = new ScreenRotationAnimation(mContext,
8929-
mFxSession, inTransaction, mCurDisplayWidth, mCurDisplayHeight,
8930-
mDisplay.getRotation());
8931-
}
8926+
8927+
mAnimator.mScreenRotationAnimation = new ScreenRotationAnimation(mContext,
8928+
mFxSession, inTransaction, mCurDisplayWidth, mCurDisplayHeight,
8929+
mDisplay.getRotation());
8930+
89328931
if (!mAnimator.mScreenRotationAnimation.hasScreenshot()) {
89338932
Surface.freezeDisplay(0);
89348933
}
@@ -8943,6 +8942,10 @@ private void stopFreezingDisplayLocked() {
89438942
}
89448943

89458944
if (mWaitingForConfig || mAppsFreezingScreen > 0 || mWindowsFreezingScreen) {
8945+
if (DEBUG_ORIENTATION) Slog.d(TAG,
8946+
"stopFreezingDisplayLocked: Returning mWaitingForConfig=" + mWaitingForConfig
8947+
+ ", mAppsFreezingScreen=" + mAppsFreezingScreen
8948+
+ ", mWindowsFreezingScreen=" + mWindowsFreezingScreen);
89468949
return;
89478950
}
89488951

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

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG;
2525
import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
2626

27-
import com.android.server.wm.WindowManagerService.H;
28-
2927
import android.content.Context;
3028
import android.content.res.Configuration;
3129
import android.graphics.Matrix;
@@ -40,15 +38,10 @@
4038
import android.view.IApplicationToken;
4139
import android.view.IWindow;
4240
import android.view.InputChannel;
43-
import android.view.Surface;
4441
import android.view.View;
4542
import android.view.ViewTreeObserver;
4643
import android.view.WindowManager;
4744
import android.view.WindowManagerPolicy;
48-
import android.view.WindowManager.LayoutParams;
49-
import android.view.animation.Animation;
50-
import android.view.animation.AnimationUtils;
51-
import android.view.animation.Transformation;
5245

5346
import java.io.PrintWriter;
5447
import java.util.ArrayList;
@@ -57,6 +50,8 @@
5750
* A window in the window manager.
5851
*/
5952
final class WindowState implements WindowManagerPolicy.WindowState {
53+
static final String TAG = "WindowState";
54+
6055
static final boolean DEBUG_VISIBILITY = WindowManagerService.DEBUG_VISIBILITY;
6156
static final boolean SHOW_TRANSACTIONS = WindowManagerService.SHOW_TRANSACTIONS;
6257
static final boolean SHOW_LIGHT_TRANSACTIONS = WindowManagerService.SHOW_LIGHT_TRANSACTIONS;
@@ -276,7 +271,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
276271
mSeq = seq;
277272
mEnforceSizeCompat = (mAttrs.flags & FLAG_COMPATIBLE_WINDOW) != 0;
278273
if (WindowManagerService.localLOGV) Slog.v(
279-
WindowManagerService.TAG, "Window " + this + " client=" + c.asBinder()
274+
TAG, "Window " + this + " client=" + c.asBinder()
280275
+ " token=" + token + " (" + mAttrs.token + ")");
281276
try {
282277
c.asBinder().linkToDeath(deathRecipient, 0);
@@ -304,7 +299,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
304299
+ WindowManagerService.TYPE_LAYER_OFFSET;
305300
mSubLayer = mPolicy.subWindowTypeToLayerLw(a.type);
306301
mAttachedWindow = attachedWindow;
307-
if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(WindowManagerService.TAG, "Adding " + this + " to " + mAttachedWindow);
302+
if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + this + " to " + mAttachedWindow);
308303
mAttachedWindow.mChildWindows.add(this);
309304
mLayoutAttached = mAttrs.type !=
310305
WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
@@ -358,7 +353,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
358353

359354
void attach() {
360355
if (WindowManagerService.localLOGV) Slog.v(
361-
WindowManagerService.TAG, "Attaching " + this + " token=" + mToken
356+
TAG, "Attaching " + this + " token=" + mToken
362357
+ ", list=" + mToken.windows);
363358
mSession.windowAddedLocked();
364359
}
@@ -496,7 +491,7 @@ public void computeFrameLw(Rect pf, Rect df, Rect cf, Rect vf) {
496491
if (WindowManagerService.localLOGV) {
497492
//if ("com.google.android.youtube".equals(mAttrs.packageName)
498493
// && mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_PANEL) {
499-
Slog.v(WindowManagerService.TAG, "Resolving (mRequestedWidth="
494+
Slog.v(TAG, "Resolving (mRequestedWidth="
500495
+ mRequestedWidth + ", mRequestedheight="
501496
+ mRequestedHeight + ") to" + " (pw=" + pw + ", ph=" + ph
502497
+ "): frame=" + mFrame.toShortString()
@@ -600,10 +595,11 @@ public boolean hasAppShownWindows() {
600595
return mAppToken != null ? mAppToken.firstWindowDrawn : false;
601596
}
602597

598+
// TODO(cmautner): Move to WindowStateAnimator
603599
boolean finishDrawingLocked() {
604600
if (mDrawPending) {
605601
if (SHOW_TRANSACTIONS || WindowManagerService.DEBUG_ORIENTATION) Slog.v(
606-
WindowManagerService.TAG, "finishDrawingLocked: " + this + " in "
602+
TAG, "finishDrawingLocked: " + this + " in "
607603
+ mWinAnimator.mSurface);
608604
mCommitDrawPending = true;
609605
mDrawPending = false;
@@ -612,6 +608,7 @@ boolean finishDrawingLocked() {
612608
return false;
613609
}
614610

611+
// TODO(cmautner): Move to WindowStateAnimator
615612
// This must be called while inside a transaction.
616613
boolean commitFinishDrawingLocked(long currentTime) {
617614
//Slog.i(TAG, "commitFinishDrawingLocked: " + mSurface);
@@ -820,7 +817,7 @@ void removeLocked() {
820817
disposeInputChannel();
821818

822819
if (mAttachedWindow != null) {
823-
if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(WindowManagerService.TAG, "Removing " + this + " from " + mAttachedWindow);
820+
if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(TAG, "Removing " + this + " from " + mAttachedWindow);
824821
mAttachedWindow.mChildWindows.remove(this);
825822
}
826823
mWinAnimator.destroyDeferredSurfaceLocked();
@@ -859,7 +856,7 @@ public void binderDied() {
859856
try {
860857
synchronized(mService.mWindowMap) {
861858
WindowState win = mService.windowForClientLocked(mSession, mClient, false);
862-
Slog.i(WindowManagerService.TAG, "WIN DEATH: " + win);
859+
Slog.i(TAG, "WIN DEATH: " + win);
863860
if (win != null) {
864861
mService.removeWindowLocked(mSession, win);
865862
}
@@ -891,9 +888,9 @@ boolean showLw(boolean doAnimation, boolean requestAnim) {
891888
// Already showing.
892889
return false;
893890
}
894-
if (DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "Policy visibility true: " + this);
891+
if (DEBUG_VISIBILITY) Slog.v(TAG, "Policy visibility true: " + this);
895892
if (doAnimation) {
896-
if (DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "doAnimation: mPolicyVisibility="
893+
if (DEBUG_VISIBILITY) Slog.v(TAG, "doAnimation: mPolicyVisibility="
897894
+ mPolicyVisibility + " mAnimation=" + mWinAnimator.mAnimation);
898895
if (!mService.okToDisplay()) {
899896
doAnimation = false;
@@ -940,7 +937,7 @@ boolean hideLw(boolean doAnimation, boolean requestAnim) {
940937
if (doAnimation) {
941938
mPolicyVisibilityAfterAnim = false;
942939
} else {
943-
if (DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "Policy visibility false: " + this);
940+
if (DEBUG_VISIBILITY) Slog.v(TAG, "Policy visibility false: " + this);
944941
mPolicyVisibilityAfterAnim = false;
945942
mPolicyVisibility = false;
946943
// Window is no longer visible -- make sure if we were waiting

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ void destroyDeferredSurfaceLocked() {
554554
mPendingDestroySurface.destroy();
555555
}
556556
} catch (RuntimeException e) {
557-
Slog.w(WindowManagerService.TAG, "Exception thrown when destroying Window "
557+
Slog.w(TAG, "Exception thrown when destroying Window "
558558
+ this + " surface " + mPendingDestroySurface
559559
+ " session " + mSession + ": " + e.toString());
560560
}
@@ -705,6 +705,7 @@ void computeShownFrameLocked() {
705705
mDsDy = 0;
706706
mDtDy = mWin.mGlobalScale;
707707
}
708+
708709
public void prepareSurfaceLocked(final boolean recoveringMemory) {
709710
final WindowState w = mWin;
710711
if (mSurface == null) {
@@ -892,15 +893,15 @@ boolean performShowLocked() {
892893
e = new RuntimeException();
893894
e.fillInStackTrace();
894895
}
895-
Slog.v(WindowManagerService.TAG, "performShow on " + this
896+
Slog.v(TAG, "performShow on " + this
896897
+ ": readyToShow=" + mWin.mReadyToShow + " readyForDisplay="
897898
+ mWin.isReadyForDisplay()
898899
+ " starting=" + (mWin.mAttrs.type == TYPE_APPLICATION_STARTING), e);
899900
}
900901
if (mWin.mReadyToShow && mWin.isReadyForDisplay()) {
901902
if (SHOW_TRANSACTIONS || WindowManagerService.DEBUG_ORIENTATION)
902903
WindowManagerService.logSurface(mWin, "SHOW (performShowLocked)", null);
903-
if (DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "Showing " + this
904+
if (DEBUG_VISIBILITY) Slog.v(TAG, "Showing " + this
904905
+ " during animation: policyVis=" + mWin.mPolicyVisibility
905906
+ " attHidden=" + mWin.mAttachedHidden
906907
+ " tok.hiddenRequested="
@@ -947,7 +948,7 @@ boolean performShowLocked() {
947948

948949
if (mWin.mAppToken.startingData != null) {
949950
if (WindowManagerService.DEBUG_STARTING_WINDOW ||
950-
WindowManagerService.DEBUG_ANIM) Slog.v(WindowManagerService.TAG,
951+
WindowManagerService.DEBUG_ANIM) Slog.v(TAG,
951952
"Finish starting " + mWin.mToken
952953
+ ": first real window is shown, no animation");
953954
// If this initial window is animating, stop it -- we
@@ -1059,7 +1060,7 @@ boolean applyAnimationLocked(int transit, boolean isEntrance) {
10591060
a = mService.loadAnimation(mWin.mAttrs, attr);
10601061
}
10611062
}
1062-
if (WindowManagerService.DEBUG_ANIM) Slog.v(WindowManagerService.TAG,
1063+
if (WindowManagerService.DEBUG_ANIM) Slog.v(TAG,
10631064
"applyAnimation: win=" + this
10641065
+ " anim=" + anim + " attr=0x" + Integer.toHexString(attr)
10651066
+ " mAnimation=" + mAnimation
@@ -1071,7 +1072,7 @@ boolean applyAnimationLocked(int transit, boolean isEntrance) {
10711072
e = new RuntimeException();
10721073
e.fillInStackTrace();
10731074
}
1074-
Slog.v(WindowManagerService.TAG, "Loaded animation " + a + " for " + this, e);
1075+
Slog.v(TAG, "Loaded animation " + a + " for " + this, e);
10751076
}
10761077
setAnimation(a);
10771078
mAnimationIsEntrance = isEntrance;

0 commit comments

Comments
 (0)