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

Commit 22135e46 authored by Craig Mautner's avatar Craig Mautner Committed by Android Git Automerger
Browse files

am d8efe424: Merge "Change DimAnimator to reflect rotations." into jb-dev

* commit 'd8efe424':
  Change DimAnimator to reflect rotations.
parents 7bd44d97 d8efe424
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -68,8 +68,10 @@ class DimAnimator {
     * {@link #updateSurface} after all windows are examined.
     * {@link #updateSurface} after all windows are examined.
     */
     */
    void updateParameters(final Resources res, final Parameters params, final long currentTime) {
    void updateParameters(final Resources res, final Parameters params, final long currentTime) {
        final int dw = params.mDimWidth;
        // Multiply by 1.5 so that rotating a frozen surface that includes this does not expose a
        final int dh = params.mDimHeight;
        // corner.
        final int dw = (int) (params.mDimWidth * 1.5);
        final int dh = (int) (params.mDimHeight * 1.5);
        final WindowStateAnimator winAnimator = params.mDimWinAnimator;
        final WindowStateAnimator winAnimator = params.mDimWinAnimator;
        final float target = params.mDimTarget;
        final float target = params.mDimTarget;
        if (!mDimShown) {
        if (!mDimShown) {
@@ -79,7 +81,8 @@ class DimAnimator {
            try {
            try {
                mLastDimWidth = dw;
                mLastDimWidth = dw;
                mLastDimHeight = dh;
                mLastDimHeight = dh;
                mDimSurface.setPosition(0, 0);
                // back off position so mDimXXX/4 is before and mDimXXX/4 is after
                mDimSurface.setPosition(-1 * dw / 6, -1 * dh /6);
                mDimSurface.setSize(dw, dh);
                mDimSurface.setSize(dw, dh);
                mDimSurface.show();
                mDimSurface.show();
            } catch (RuntimeException e) {
            } catch (RuntimeException e) {
@@ -89,6 +92,8 @@ class DimAnimator {
            mLastDimWidth = dw;
            mLastDimWidth = dw;
            mLastDimHeight = dh;
            mLastDimHeight = dh;
            mDimSurface.setSize(dw, dh);
            mDimSurface.setSize(dw, dh);
            // back off position so mDimXXX/4 is before and mDimXXX/4 is after
            mDimSurface.setPosition(-1 * dw / 6, -1 * dh /6);
        }
        }


        mDimSurface.setLayer(winAnimator.mAnimLayer - WindowManagerService.LAYER_OFFSET_DIM);
        mDimSurface.setLayer(winAnimator.mAnimLayer - WindowManagerService.LAYER_OFFSET_DIM);
+4 −0
Original line number Original line Diff line number Diff line
@@ -951,6 +951,10 @@ class WindowStateAnimator {
                mSurface.setSize(width, height);
                mSurface.setSize(width, height);
                mAnimator.mPendingLayoutChanges |=
                mAnimator.mPendingLayoutChanges |=
                        WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
                        WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
                if ((w.mAttrs.flags & LayoutParams.FLAG_DIM_BEHIND) != 0) {
                    mAnimator.startDimming(this, w.mExiting ? 0 : w.mAttrs.dimAmount,
                            mService.mAppDisplayWidth, mService.mAppDisplayHeight);
                }
            } catch (RuntimeException e) {
            } catch (RuntimeException e) {
                // If something goes wrong with the surface (such
                // If something goes wrong with the surface (such
                // as running out of memory), don't take down the
                // as running out of memory), don't take down the