Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15d5a964 authored by Craig Mautner's avatar Craig Mautner Committed by Android (Google) Code Review
Browse files

Merge "Remove obsolete variable masking valid one."

parents f64bf84e d87946ba
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -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());
            }

            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;
        }
        
+14 −17
Original line number Diff line number Diff line
@@ -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
+7 −6
Original line number Diff line number Diff line
@@ -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;