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

Commit 2fb98b14 authored by Craig Mautner's avatar Craig Mautner
Browse files

Minor refactoring prior to major refactoring.

Removal of blur layer.
Deferral of Surface actions in BlackFrame from ctor to first use.
Combine common test into single method okToDisplay().
Remove redundant logic in DimAnimator.

Change-Id: I43af0415794a8f142803ce94d7e17539aafac67d
parent d3ae2202
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -222,7 +222,7 @@ class AppWindowToken extends WindowToken {


    // This must be called while inside a transaction.
    // This must be called while inside a transaction.
    boolean stepAnimationLocked(long currentTime, int dw, int dh) {
    boolean stepAnimationLocked(long currentTime, int dw, int dh) {
        if (!service.mDisplayFrozen && service.mPolicy.isScreenOnFully()) {
        if (service.okToDisplay()) {
            // We will run animations as long as the display isn't frozen.
            // We will run animations as long as the display isn't frozen.


            if (animation == WindowManagerService.sDummyAnimation) {
            if (animation == WindowManagerService.sDummyAnimation) {
+4 −2
Original line number Original line Diff line number Diff line
@@ -32,12 +32,14 @@ public class BlackFrame {
    class BlackSurface {
    class BlackSurface {
        final int left;
        final int left;
        final int top;
        final int top;
        final int layer;
        final Surface surface;
        final Surface surface;


        BlackSurface(SurfaceSession session, int layer, int l, int t, int r, int b)
        BlackSurface(SurfaceSession session, int layer, int l, int t, int r, int b)
                throws Surface.OutOfResourcesException {
                throws Surface.OutOfResourcesException {
            left = l;
            left = l;
            top = t;
            top = t;
            this.layer = layer;
            int w = r-l;
            int w = r-l;
            int h = b-t;
            int h = b-t;
            surface = new Surface(session, 0, "BlackSurface",
            surface = new Surface(session, 0, "BlackSurface",
@@ -45,8 +47,6 @@ public class BlackFrame {
            if (WindowManagerService.SHOW_TRANSACTIONS ||
            if (WindowManagerService.SHOW_TRANSACTIONS ||
                    WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(WindowManagerService.TAG,
                    WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(WindowManagerService.TAG,
                            "  BLACK " + surface + ": CREATE layer=" + layer);
                            "  BLACK " + surface + ": CREATE layer=" + layer);
            surface.setAlpha(1.0f);
            surface.setLayer(layer);
        }
        }


        void setMatrix(Matrix matrix) {
        void setMatrix(Matrix matrix) {
@@ -58,6 +58,8 @@ public class BlackFrame {
            surface.setMatrix(
            surface.setMatrix(
                    mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_Y],
                    mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_Y],
                    mTmpFloats[Matrix.MSKEW_X], mTmpFloats[Matrix.MSCALE_Y]);
                    mTmpFloats[Matrix.MSKEW_X], mTmpFloats[Matrix.MSCALE_Y]);
            surface.setAlpha(1.0f);
            surface.setLayer(layer);
            if (false) {
            if (false) {
                Slog.i(WindowManagerService.TAG, "Black Surface @ (" + left + "," + top + "): ("
                Slog.i(WindowManagerService.TAG, "Black Surface @ (" + left + "," + top + "): ("
                        + mTmpFloats[Matrix.MTRANS_X] + ","
                        + mTmpFloats[Matrix.MTRANS_X] + ","
+7 −9
Original line number Original line Diff line number Diff line
@@ -130,33 +130,31 @@ class DimAnimator {
            }
            }
        }
        }


        boolean animating = false;
        boolean animating = mLastDimAnimTime != 0;
        if (mLastDimAnimTime != 0) {
        if (animating) {
            mDimCurrentAlpha += mDimDeltaPerMs
            mDimCurrentAlpha += mDimDeltaPerMs
                    * (currentTime-mLastDimAnimTime);
                    * (currentTime-mLastDimAnimTime);
            boolean more = true;
            if (displayFrozen) {
            if (displayFrozen) {
                // If the display is frozen, there is no reason to animate.
                // If the display is frozen, there is no reason to animate.
                more = false;
                animating = false;
            } else if (mDimDeltaPerMs > 0) {
            } else if (mDimDeltaPerMs > 0) {
                if (mDimCurrentAlpha > mDimTargetAlpha) {
                if (mDimCurrentAlpha > mDimTargetAlpha) {
                    more = false;
                    animating = false;
                }
                }
            } else if (mDimDeltaPerMs < 0) {
            } else if (mDimDeltaPerMs < 0) {
                if (mDimCurrentAlpha < mDimTargetAlpha) {
                if (mDimCurrentAlpha < mDimTargetAlpha) {
                    more = false;
                    animating = false;
                }
                }
            } else {
            } else {
                more = false;
                animating = false;
            }
            }


            // Do we need to continue animating?
            // Do we need to continue animating?
            if (more) {
            if (animating) {
                if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, "  DIM "
                if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, "  DIM "
                        + mDimSurface + ": alpha=" + mDimCurrentAlpha);
                        + mDimSurface + ": alpha=" + mDimCurrentAlpha);
                mLastDimAnimTime = currentTime;
                mLastDimAnimTime = currentTime;
                mDimSurface.setAlpha(mDimCurrentAlpha);
                mDimSurface.setAlpha(mDimCurrentAlpha);
                animating = true;
            } else {
            } else {
                mDimCurrentAlpha = mDimTargetAlpha;
                mDimCurrentAlpha = mDimTargetAlpha;
                mLastDimAnimTime = 0;
                mLastDimAnimTime = 0;
+63 −139
Original line number Original line Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.server.wm;


import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
import static android.view.WindowManager.LayoutParams.FLAG_BLUR_BEHIND;
import static android.view.WindowManager.LayoutParams.FLAG_COMPATIBLE_WINDOW;
import static android.view.WindowManager.LayoutParams.FLAG_COMPATIBLE_WINDOW;
import static android.view.WindowManager.LayoutParams.FLAG_DIM_BEHIND;
import static android.view.WindowManager.LayoutParams.FLAG_DIM_BEHIND;
import static android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
import static android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
@@ -173,7 +172,6 @@ public class WindowManagerService extends IWindowManager.Stub
    static final boolean HIDE_STACK_CRAWLS = true;
    static final boolean HIDE_STACK_CRAWLS = true;


    static final boolean PROFILE_ORIENTATION = false;
    static final boolean PROFILE_ORIENTATION = false;
    static final boolean BLUR = true;
    static final boolean localLOGV = DEBUG;
    static final boolean localLOGV = DEBUG;


    /** How much to multiply the policy's type layer, to reserve room
    /** How much to multiply the policy's type layer, to reserve room
@@ -195,11 +193,6 @@ public class WindowManagerService extends IWindowManager.Stub
     */
     */
    static final int LAYER_OFFSET_DIM = 1;
    static final int LAYER_OFFSET_DIM = 1;


    /**
     * Blur surface layer is immediately below dim layer.
     */
    static final int LAYER_OFFSET_BLUR = 2;

    /**
    /**
     * Layer at which to put the rotation freeze snapshot.
     * Layer at which to put the rotation freeze snapshot.
     */
     */
@@ -416,8 +409,6 @@ public class WindowManagerService extends IWindowManager.Stub


    SurfaceSession mFxSession;
    SurfaceSession mFxSession;
    private DimAnimator mDimAnimator = null;
    private DimAnimator mDimAnimator = null;
    Surface mBlurSurface;
    boolean mBlurShown;
    Watermark mWatermark;
    Watermark mWatermark;
    StrictModeFlash mStrictModeFlash;
    StrictModeFlash mStrictModeFlash;
    ScreenRotationAnimation mScreenRotationAnimation;
    ScreenRotationAnimation mScreenRotationAnimation;
@@ -597,7 +588,6 @@ public class WindowManagerService extends IWindowManager.Stub
        private int mAdjResult = 0;
        private int mAdjResult = 0;
        private Session mHoldScreen = null;
        private Session mHoldScreen = null;
        private boolean mObscured = false;
        private boolean mObscured = false;
        private boolean mBlurring = false;
        private boolean mDimming = false;
        private boolean mDimming = false;
        private boolean mSyswin = false;
        private boolean mSyswin = false;
        private float mScreenBrightness = -1;
        private float mScreenBrightness = -1;
@@ -735,6 +725,7 @@ public class WindowManagerService extends IWindowManager.Stub
            mAllowBootMessages = allowBootMsgs;
            mAllowBootMessages = allowBootMsgs;
        }
        }


        @Override
        public void run() {
        public void run() {
            Looper.prepare();
            Looper.prepare();
            WindowManagerService s = new WindowManagerService(mContext, mPM,
            WindowManagerService s = new WindowManagerService(mContext, mPM,
@@ -774,6 +765,7 @@ public class WindowManagerService extends IWindowManager.Stub
            mPM = pm;
            mPM = pm;
        }
        }


        @Override
        public void run() {
        public void run() {
            Looper.prepare();
            Looper.prepare();
            WindowManagerPolicyThread.set(this, Looper.myLooper());
            WindowManagerPolicyThread.set(this, Looper.myLooper());
@@ -2302,8 +2294,7 @@ public class WindowManagerService extends IWindowManager.Stub
        // to hold off on removing the window until the animation is done.
        // to hold off on removing the window until the animation is done.
        // If the display is frozen, just remove immediately, since the
        // If the display is frozen, just remove immediately, since the
        // animation wouldn't be seen.
        // animation wouldn't be seen.
        if (win.mSurface != null && !mDisplayFrozen && mDisplayEnabled
        if (win.mSurface != null && okToDisplay()) {
                && mPolicy.isScreenOnFully()) {
            // If we are not currently running the exit animation, we
            // If we are not currently running the exit animation, we
            // need to see about starting one.
            // need to see about starting one.
            if (wasVisible=win.isWinVisibleLw()) {
            if (wasVisible=win.isWinVisibleLw()) {
@@ -2687,8 +2678,7 @@ public class WindowManagerService extends IWindowManager.Stub
                    win.mEnterAnimationPending = true;
                    win.mEnterAnimationPending = true;
                }
                }
                if (displayed) {
                if (displayed) {
                    if (win.isDrawnLw() && !mDisplayFrozen
                    if (win.isDrawnLw() && okToDisplay()) {
                            && mDisplayEnabled && mPolicy.isScreenOnFully()) {
                        applyEnterAnimationLocked(win);
                        applyEnterAnimationLocked(win);
                    }
                    }
                    if ((win.mAttrs.flags
                    if ((win.mAttrs.flags
@@ -3015,7 +3005,7 @@ public class WindowManagerService extends IWindowManager.Stub
        // frozen, there is no reason to animate and it can cause strange
        // frozen, there is no reason to animate and it can cause strange
        // artifacts when we unfreeze the display if some different animation
        // artifacts when we unfreeze the display if some different animation
        // is running.
        // is running.
        if (!mDisplayFrozen && mDisplayEnabled && mPolicy.isScreenOnFully()) {
        if (okToDisplay()) {
            int anim = mPolicy.selectAnimationLw(win, transit);
            int anim = mPolicy.selectAnimationLw(win, transit);
            int attr = -1;
            int attr = -1;
            Animation a = null;
            Animation a = null;
@@ -3101,7 +3091,7 @@ public class WindowManagerService extends IWindowManager.Stub
        // frozen, there is no reason to animate and it can cause strange
        // frozen, there is no reason to animate and it can cause strange
        // artifacts when we unfreeze the display if some different animation
        // artifacts when we unfreeze the display if some different animation
        // is running.
        // is running.
        if (!mDisplayFrozen && mDisplayEnabled && mPolicy.isScreenOnFully()) {
        if (okToDisplay()) {
            Animation a;
            Animation a;
            if (mNextAppTransitionPackage != null) {
            if (mNextAppTransitionPackage != null) {
                a = loadAnimation(mNextAppTransitionPackage, enter ?
                a = loadAnimation(mNextAppTransitionPackage, enter ?
@@ -3235,6 +3225,10 @@ public class WindowManagerService extends IWindowManager.Stub
        return false;
        return false;
    }
    }
    
    
    boolean okToDisplay() {
        return !mDisplayFrozen && mDisplayEnabled && mPolicy.isScreenOnFully();
    }

    AppWindowToken findAppWindowToken(IBinder token) {
    AppWindowToken findAppWindowToken(IBinder token) {
        WindowToken wtoken = mTokenMap.get(token);
        WindowToken wtoken = mTokenMap.get(token);
        if (wtoken == null) {
        if (wtoken == null) {
@@ -3665,7 +3659,7 @@ public class WindowManagerService extends IWindowManager.Stub
            if (DEBUG_APP_TRANSITIONS) Slog.v(
            if (DEBUG_APP_TRANSITIONS) Slog.v(
                    TAG, "Prepare app transition: transit=" + transit
                    TAG, "Prepare app transition: transit=" + transit
                    + " mNextAppTransition=" + mNextAppTransition);
                    + " mNextAppTransition=" + mNextAppTransition);
            if (!mDisplayFrozen && mDisplayEnabled && mPolicy.isScreenOnFully()) {
            if (okToDisplay()) {
                if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET
                if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET
                        || mNextAppTransition == WindowManagerPolicy.TRANSIT_NONE) {
                        || mNextAppTransition == WindowManagerPolicy.TRANSIT_NONE) {
                    mNextAppTransition = transit;
                    mNextAppTransition = transit;
@@ -3749,7 +3743,7 @@ public class WindowManagerService extends IWindowManager.Stub
            // If the display is frozen, we won't do anything until the
            // If the display is frozen, we won't do anything until the
            // actual window is displayed so there is no reason to put in
            // actual window is displayed so there is no reason to put in
            // the starting window.
            // the starting window.
            if (mDisplayFrozen || !mDisplayEnabled || !mPolicy.isScreenOnFully()) {
            if (!okToDisplay()) {
                return;
                return;
            }
            }


@@ -4039,8 +4033,7 @@ public class WindowManagerService extends IWindowManager.Stub


            // If we are preparing an app transition, then delay changing
            // If we are preparing an app transition, then delay changing
            // the visibility of this token until we execute that transition.
            // the visibility of this token until we execute that transition.
            if (!mDisplayFrozen && mDisplayEnabled && mPolicy.isScreenOnFully()
            if (okToDisplay() && mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) {
                    && mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) {
                // Already in requested state, don't do anything more.
                // Already in requested state, don't do anything more.
                if (wtoken.hiddenRequested != visible) {
                if (wtoken.hiddenRequested != visible) {
                    return;
                    return;
@@ -4168,7 +4161,7 @@ public class WindowManagerService extends IWindowManager.Stub
        }
        }


        synchronized(mWindowMap) {
        synchronized(mWindowMap) {
            if (configChanges == 0 && !mDisplayFrozen && mPolicy.isScreenOnFully()) {
            if (configChanges == 0 && okToDisplay()) {
                if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping set freeze of " + token);
                if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping set freeze of " + token);
                return;
                return;
            }
            }
@@ -5476,7 +5469,7 @@ public class WindowManagerService extends IWindowManager.Stub
            }
            }
        }
        }


        rebuildBlackFrame(inTransaction);
        rebuildBlackFrame();


        for (int i=mWindows.size()-1; i>=0; i--) {
        for (int i=mWindows.size()-1; i>=0; i--) {
            WindowState w = mWindows.get(i);
            WindowState w = mWindows.get(i);
@@ -7151,13 +7144,7 @@ public class WindowManagerService extends IWindowManager.Stub
        }
        }
    }
    }


    private void rebuildBlackFrame(boolean inTransaction) {
    private void rebuildBlackFrame() {
        if (!inTransaction) {
            if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
                    ">>> OPEN TRANSACTION rebuildBlackFrame");
            Surface.openTransaction();
        }
        try {
        if (mBlackFrame != null) {
        if (mBlackFrame != null) {
            mBlackFrame.kill();
            mBlackFrame.kill();
            mBlackFrame = null;
            mBlackFrame = null;
@@ -7185,13 +7172,6 @@ public class WindowManagerService extends IWindowManager.Stub
            } catch (Surface.OutOfResourcesException e) {
            } catch (Surface.OutOfResourcesException e) {
            }
            }
        }
        }
        } finally {
            if (!inTransaction) {
                Surface.closeTransaction();
                if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
                        "<<< CLOSE TRANSACTION rebuildBlackFrame");
            }
        }
    }
    }


    private void readForcedDisplaySizeLocked() {
    private void readForcedDisplaySizeLocked() {
@@ -7240,7 +7220,7 @@ public class WindowManagerService extends IWindowManager.Stub
            mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
            mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
        }
        }


        rebuildBlackFrame(false);
        rebuildBlackFrame();


        performLayoutAndPlaceSurfacesLocked();
        performLayoutAndPlaceSurfacesLocked();
    }
    }
@@ -7625,7 +7605,7 @@ public class WindowManagerService extends IWindowManager.Stub
        // If the screen is currently frozen or off, then keep
        // If the screen is currently frozen or off, then keep
        // it frozen/off until this window draws at its new
        // it frozen/off until this window draws at its new
        // orientation.
        // orientation.
        if (mDisplayFrozen || !mPolicy.isScreenOnFully()) {
        if (!okToDisplay()) {
            if (DEBUG_ORIENTATION) Slog.v(TAG,
            if (DEBUG_ORIENTATION) Slog.v(TAG,
                    "Changing surface while display frozen: " + w);
                    "Changing surface while display frozen: " + w);
            w.mOrientationChanging = true;
            w.mOrientationChanging = true;
@@ -7707,18 +7687,7 @@ public class WindowManagerService extends IWindowManager.Stub
            if (mDimAnimator != null && mDimAnimator.mDimShown) {
            if (mDimAnimator != null && mDimAnimator.mDimShown) {
                mInnerFields.mAnimating |=
                mInnerFields.mAnimating |=
                        mDimAnimator.updateSurface(mInnerFields.mDimming, currentTime,
                        mDimAnimator.updateSurface(mInnerFields.mDimming, currentTime,
                            mDisplayFrozen || !mDisplayEnabled || !mPolicy.isScreenOnFully());
                            !okToDisplay());
            }
        
            if (!mInnerFields.mBlurring && mBlurShown) {
                if (SHOW_TRANSACTIONS) Slog.i(TAG, "  BLUR " + mBlurSurface
                        + ": HIDE");
                try {
                    mBlurSurface.hide();
                } catch (IllegalArgumentException e) {
                    Slog.w(TAG, "Illegal argument exception hiding blur surface");
                }
                mBlurShown = false;
            }
            }
        
        
            if (mBlackFrame != null) {
            if (mBlackFrame != null) {
@@ -7747,6 +7716,8 @@ public class WindowManagerService extends IWindowManager.Stub
     */
     */
    private int updateWindowsAndWallpaperLocked(final long currentTime, final int dw, final int dh,
    private int updateWindowsAndWallpaperLocked(final long currentTime, final int dw, final int dh,
                                                final int innerDw, final int innerDh) {
                                                final int innerDw, final int innerDh) {
        ++mTransactionSequence;

        int changes = 0;
        int changes = 0;
        for (int i = mWindows.size() - 1; i >= 0; i--) {
        for (int i = mWindows.size() - 1; i >= 0; i--) {
            WindowState w = mWindows.get(i);
            WindowState w = mWindows.get(i);
@@ -8301,9 +8272,9 @@ public class WindowManagerService extends IWindowManager.Stub
            // target, then the black goes *below* the wallpaper so we
            // target, then the black goes *below* the wallpaper so we
            // don't cause the wallpaper to suddenly disappear.
            // don't cause the wallpaper to suddenly disappear.
            WindowState target = mInnerFields.mWindowAnimationBackground;
            WindowState target = mInnerFields.mWindowAnimationBackground;
            if (mWallpaperTarget == mInnerFields.mWindowAnimationBackground
            if (mWallpaperTarget == target
                    || mLowerWallpaperTarget == mInnerFields.mWindowAnimationBackground
                    || mLowerWallpaperTarget == target
                    || mUpperWallpaperTarget == mInnerFields.mWindowAnimationBackground) {
                    || mUpperWallpaperTarget == target) {
                for (int i=0; i<mWindows.size(); i++) {
                for (int i=0; i<mWindows.size(); i++) {
                    WindowState w = mWindows.get(i);
                    WindowState w = mWindows.get(i);
                    if (w.mIsWallpaper) {
                    if (w.mIsWallpaper) {
@@ -8656,14 +8627,11 @@ public class WindowManagerService extends IWindowManager.Stub
        boolean opaqueDrawn = canBeSeen && w.isOpaqueDrawn();
        boolean opaqueDrawn = canBeSeen && w.isOpaqueDrawn();
        if (opaqueDrawn && w.isFullscreen(innerDw, innerDh)) {
        if (opaqueDrawn && w.isFullscreen(innerDw, innerDh)) {
            // This window completely covers everything behind it,
            // This window completely covers everything behind it,
            // so we want to leave all of them as unblurred (for
            // so we want to leave all of them as undimmed (for
            // performance reasons).
            // performance reasons).
            mInnerFields.mObscured = true;
            mInnerFields.mObscured = true;
        } else if (canBeSeen && (attrFlags & (FLAG_BLUR_BEHIND | FLAG_DIM_BEHIND)) != 0) {
        } else if (canBeSeen && (attrFlags & FLAG_DIM_BEHIND) != 0) {
            if (localLOGV) Slog.v(TAG, "Win " + w
            if (localLOGV) Slog.v(TAG, "Win " + w + " obscured=" + mInnerFields.mObscured);
                    + ": blurring=" + mInnerFields.mBlurring
                    + " obscured=" + mInnerFields.mObscured);
            if ((attrFlags&FLAG_DIM_BEHIND) != 0) {
            if (!mInnerFields.mDimming) {
            if (!mInnerFields.mDimming) {
                //Slog.i(TAG, "DIM BEHIND: " + w);
                //Slog.i(TAG, "DIM BEHIND: " + w);
                mInnerFields.mDimming = true;
                mInnerFields.mDimming = true;
@@ -8679,52 +8647,10 @@ public class WindowManagerService extends IWindowManager.Stub
                        w, currentTime);
                        w, currentTime);
            }
            }
        }
        }
            if ((attrFlags & FLAG_BLUR_BEHIND) != 0) {
                if (!mInnerFields.mBlurring) {
                    //Slog.i(TAG, "BLUR BEHIND: " + w);
                    mInnerFields.mBlurring = true;
                    if (mBlurSurface == null) {
                        try {
                            mBlurSurface = new Surface(mFxSession, 0,
                                    "BlurSurface",
                                    -1, 16, 16,
                                    PixelFormat.OPAQUE,
                                    Surface.FX_SURFACE_BLUR);
                        } catch (Exception e) {
                            Slog.e(TAG, "Exception creating Blur surface", e);
                        }
                        if (SHOW_TRANSACTIONS) Slog.i(TAG, "  BLUR "
                                + mBlurSurface + ": CREATE");
                    }
                    final int dw = mCurDisplayWidth;
                    final int dh = mCurDisplayHeight;
                    if (mBlurSurface != null) {
                        if (SHOW_TRANSACTIONS) Slog.i(TAG, "  BLUR "
                                + mBlurSurface + ": pos=(0,0) (" +
                                dw + "x" + dh + "), layer=" + (w.mAnimLayer-1));
                        mBlurSurface.setPosition(0, 0);
                        mBlurSurface.setSize(dw, dh);
                        mBlurSurface.setLayer(w.mAnimLayer-LAYER_OFFSET_BLUR);
                        if (!mBlurShown) {
                            try {
                                if (SHOW_TRANSACTIONS) Slog.i(TAG, "  BLUR "
                                        + mBlurSurface + ": SHOW");
                                mBlurSurface.show();
                            } catch (RuntimeException e) {
                                Slog.w(TAG, "Failure showing blur surface", e);
                            }
                            mBlurShown = true;
                        }
                    }
                }
            }
        }
    }
    }


    private final int performAnimationsLocked(long currentTime, int dw, int dh,
    private final int performAnimationsLocked(long currentTime, int dw, int dh,
            int innerDw, int innerDh) {
            int innerDw, int innerDh) {
        ++mTransactionSequence;

        if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "*** ANIM STEP: seq="
        if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "*** ANIM STEP: seq="
                + mTransactionSequence + " mAnimating="
                + mTransactionSequence + " mAnimating="
                + mInnerFields.mAnimating);
                + mInnerFields.mAnimating);
@@ -8895,7 +8821,6 @@ public class WindowManagerService extends IWindowManager.Stub
            final boolean someoneLosingFocus = !mLosingFocus.isEmpty();
            final boolean someoneLosingFocus = !mLosingFocus.isEmpty();


            mInnerFields.mObscured = false;
            mInnerFields.mObscured = false;
            mInnerFields.mBlurring = false;
            mInnerFields.mDimming = false;
            mInnerFields.mDimming = false;
            mInnerFields.mSyswin = false;
            mInnerFields.mSyswin = false;
            
            
@@ -9986,8 +9911,7 @@ public class WindowManagerService extends IWindowManager.Stub
            }
            }
            pw.print("  mSystemBooted="); pw.print(mSystemBooted);
            pw.print("  mSystemBooted="); pw.print(mSystemBooted);
                    pw.print(" mDisplayEnabled="); pw.println(mDisplayEnabled);
                    pw.print(" mDisplayEnabled="); pw.println(mDisplayEnabled);
            pw.print("  mLayoutNeeded="); pw.print(mLayoutNeeded);
            pw.print("  mLayoutNeeded="); pw.println(mLayoutNeeded);
                    pw.print(" mBlurShown="); pw.println(mBlurShown);
            if (mDimAnimator != null) {
            if (mDimAnimator != null) {
                pw.println("  mDimAnimator:");
                pw.println("  mDimAnimator:");
                mDimAnimator.printTo("    ", pw);
                mDimAnimator.printTo("    ", pw);
+5 −6
Original line number Original line Diff line number Diff line
@@ -1011,7 +1011,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        // Save the animation state as it was before this step so WindowManagerService can tell if
        // Save the animation state as it was before this step so WindowManagerService can tell if
        // we just started or just stopped animating by comparing mWasAnimating with isAnimating().
        // we just started or just stopped animating by comparing mWasAnimating with isAnimating().
        mWasAnimating = mAnimating;
        mWasAnimating = mAnimating;
        if (!mService.mDisplayFrozen && mService.mPolicy.isScreenOnFully()) {
        if (mService.okToDisplay()) {
            // We will run animations as long as the display isn't frozen.
            // We will run animations as long as the display isn't frozen.


            if (isDrawnLw() && mAnimation != null) {
            if (isDrawnLw() && mAnimation != null) {
@@ -1515,11 +1515,10 @@ final class WindowState implements WindowManagerPolicy.WindowState {
     * sense to call from performLayoutAndPlaceSurfacesLockedInner().)
     * sense to call from performLayoutAndPlaceSurfacesLockedInner().)
     */
     */
    boolean shouldAnimateMove() {
    boolean shouldAnimateMove() {
        return mContentChanged && !mExiting && !mLastHidden && !mService.mDisplayFrozen
        return mContentChanged && !mExiting && !mLastHidden && mService.okToDisplay()
                && (mFrame.top != mLastFrame.top
                && (mFrame.top != mLastFrame.top
                        || mFrame.left != mLastFrame.left)
                        || mFrame.left != mLastFrame.left)
                && (mAttachedWindow == null || !mAttachedWindow.shouldAnimateMove())
                && (mAttachedWindow == null || !mAttachedWindow.shouldAnimateMove());
                && mService.mPolicy.isScreenOnFully();
    }
    }


    boolean isFullscreen(int screenWidth, int screenHeight) {
    boolean isFullscreen(int screenWidth, int screenHeight) {
@@ -1606,7 +1605,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        if (doAnimation) {
        if (doAnimation) {
            if (DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "doAnimation: mPolicyVisibility="
            if (DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "doAnimation: mPolicyVisibility="
                    + mPolicyVisibility + " mAnimation=" + mAnimation);
                    + mPolicyVisibility + " mAnimation=" + mAnimation);
            if (mService.mDisplayFrozen || !mService.mPolicy.isScreenOnFully()) {
            if (!mService.okToDisplay()) {
                doAnimation = false;
                doAnimation = false;
            } else if (mPolicyVisibility && mAnimation == null) {
            } else if (mPolicyVisibility && mAnimation == null) {
                // Check for the case where we are currently visible and
                // Check for the case where we are currently visible and
@@ -1632,7 +1631,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {


    boolean hideLw(boolean doAnimation, boolean requestAnim) {
    boolean hideLw(boolean doAnimation, boolean requestAnim) {
        if (doAnimation) {
        if (doAnimation) {
            if (mService.mDisplayFrozen || !mService.mPolicy.isScreenOnFully()) {
            if (!mService.okToDisplay()) {
                doAnimation = false;
                doAnimation = false;
            }
            }
        }
        }