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

Commit c573aa7c authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge changes I80100f39,I4b39c1c4,I65ce9a23,I5094a137,Id898752f, ...

* changes:
  Make sure SysUI is not constantly redrawing status bar
  Fix app staying in drag resizing when undocking
  Fix flicker when dismissing non-docked stack
  Start drawing immediately
  Improve dismiss/scrolling handling in recents
  Dim harder when dismissing
parents afaf0525 936233c7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -271,7 +271,7 @@ public abstract class WallpaperService extends Service {
            @Override
            public void resized(Rect frame, Rect overscanInsets, Rect contentInsets,
                    Rect visibleInsets, Rect stableInsets, Rect outsets, boolean reportDraw,
                    Configuration newConfig, Rect backDropRect) {
                    Configuration newConfig, Rect backDropRect, boolean forceLayout) {
                Message msg = mCaller.obtainMessageIO(MSG_WINDOW_RESIZED,
                        reportDraw ? 1 : 0, outsets);
                mCaller.sendMessage(msg);
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ oneway interface IWindow {

    void resized(in Rect frame, in Rect overscanInsets, in Rect contentInsets,
            in Rect visibleInsets, in Rect stableInsets, in Rect outsets, boolean reportDraw,
            in Configuration newConfig, in Rect backDropFrame);
            in Configuration newConfig, in Rect backDropFrame, boolean forceLayout);
    void moved(int newX, int newY);
    void dispatchAppVisibility(boolean visible);
    void dispatchGetNewSurface();
+3 −2
Original line number Diff line number Diff line
@@ -698,7 +698,7 @@ public class SurfaceView extends View {
        @Override
        public void resized(Rect frame, Rect overscanInsets, Rect contentInsets,
                Rect visibleInsets, Rect stableInsets, Rect outsets, boolean reportDraw,
                Configuration newConfig, Rect backDropRect) {
                Configuration newConfig, Rect backDropRect, boolean forceLayout) {
            SurfaceView surfaceView = mSurfaceView.get();
            if (surfaceView != null) {
                if (DEBUG) Log.v(
@@ -711,7 +711,8 @@ public class SurfaceView extends View {
                        surfaceView.mReportDrawNeeded = true;
                        surfaceView.mHandler.sendEmptyMessage(UPDATE_WINDOW_MSG);
                    } else if (surfaceView.mWinFrame.width() != frame.width()
                            || surfaceView.mWinFrame.height() != frame.height()) {
                            || surfaceView.mWinFrame.height() != frame.height()
                            || forceLayout) {
                        surfaceView.mUpdateWindowNeeded = true;
                        surfaceView.mHandler.sendEmptyMessage(UPDATE_WINDOW_MSG);
                    }
+14 −6
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.view;

import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY;
import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD;
@@ -263,6 +264,7 @@ public final class ViewRootImpl implements ViewParent,
    boolean mNewSurfaceNeeded;
    boolean mHasHadWindowFocus;
    boolean mLastWasImTarget;
    boolean mForceNextWindowRelayout;
    CountDownLatch mWindowDrawCountDown;

    boolean mIsDrawing;
@@ -1625,7 +1627,8 @@ public final class ViewRootImpl implements ViewParent,

        final boolean isViewVisible = viewVisibility == View.VISIBLE;
        if (mFirst || windowShouldResize || insetsChanged ||
                viewVisibilityChanged || params != null) {
                viewVisibilityChanged || params != null || mForceNextWindowRelayout) {
            mForceNextWindowRelayout = false;

            if (isViewVisible) {
                // If this window is giving internal insets to the window
@@ -2099,7 +2102,7 @@ public final class ViewRootImpl implements ViewParent,

        boolean cancelDraw = mAttachInfo.mTreeObserver.dispatchOnPreDraw() || !isViewVisible;

        if (!cancelDraw && !newSurface) {
        if (!cancelDraw) {
            if (mPendingTransitions != null && mPendingTransitions.size() > 0) {
                for (int i = 0; i < mPendingTransitions.size(); ++i) {
                    mPendingTransitions.get(i).startChangingAnimations();
@@ -2148,6 +2151,7 @@ public final class ViewRootImpl implements ViewParent,
            }
        }
    }

    private void handleOutOfResourcesException(Surface.OutOfResourcesException e) {
        Log.e(mTag, "OutOfResourcesException initializing HW surface", e);
        try {
@@ -3365,7 +3369,8 @@ public final class ViewRootImpl implements ViewParent,
                        && mPendingVisibleInsets.equals(args.arg3)
                        && mPendingOutsets.equals(args.arg7)
                        && mPendingBackDropFrame.equals(args.arg8)
                        && args.arg4 == null) {
                        && args.arg4 == null
                        && args.argi1 == 0) {
                    break;
                }
                } // fall through...
@@ -3385,6 +3390,7 @@ public final class ViewRootImpl implements ViewParent,
                    mPendingVisibleInsets.set((Rect) args.arg3);
                    mPendingOutsets.set((Rect) args.arg7);
                    mPendingBackDropFrame.set((Rect) args.arg8);
                    mForceNextWindowRelayout = args.argi1 != 0;

                    args.recycle();

@@ -5829,7 +5835,7 @@ public final class ViewRootImpl implements ViewParent,

    public void dispatchResized(Rect frame, Rect overscanInsets, Rect contentInsets,
            Rect visibleInsets, Rect stableInsets, Rect outsets, boolean reportDraw,
            Configuration newConfig, Rect backDropFrame) {
            Configuration newConfig, Rect backDropFrame, boolean forceLayout) {
        if (DEBUG_LAYOUT) Log.v(mTag, "Resizing " + this + ": frame=" + frame.toShortString()
                + " contentInsets=" + contentInsets.toShortString()
                + " visibleInsets=" + visibleInsets.toShortString()
@@ -5863,6 +5869,7 @@ public final class ViewRootImpl implements ViewParent,
        args.arg6 = sameProcessCall ? new Rect(stableInsets) : stableInsets;
        args.arg7 = sameProcessCall ? new Rect(outsets) : outsets;
        args.arg8 = sameProcessCall ? new Rect(backDropFrame) : backDropFrame;
        args.argi1 = forceLayout ? 1 : 0;
        msg.obj = args;
        mHandler.sendMessage(msg);
    }
@@ -6878,11 +6885,12 @@ public final class ViewRootImpl implements ViewParent,
        @Override
        public void resized(Rect frame, Rect overscanInsets, Rect contentInsets,
                Rect visibleInsets, Rect stableInsets, Rect outsets, boolean reportDraw,
                Configuration newConfig, Rect backDropFrame) {
                Configuration newConfig, Rect backDropFrame, boolean forceLayout) {
            final ViewRootImpl viewAncestor = mViewAncestor.get();
            if (viewAncestor != null) {
                viewAncestor.dispatchResized(frame, overscanInsets, contentInsets,
                        visibleInsets, stableInsets, outsets, reportDraw, newConfig, backDropFrame);
                        visibleInsets, stableInsets, outsets, reportDraw, newConfig, backDropFrame,
                        forceLayout);
            }
        }

+6 −1
Original line number Diff line number Diff line
@@ -139,7 +139,12 @@ public class DividerSnapAlgorithm {
    }

    public SnapTarget getClosestDismissTarget(int position) {
        if (position - mDismissStartTarget.position < mDismissEndTarget.position - position) {
        if (position < mFirstSplitTarget.position) {
            return mDismissStartTarget;
        } else if (position > mLastSplitTarget.position) {
            return mDismissEndTarget;
        } else if (position - mDismissStartTarget.position
                < mDismissEndTarget.position - position) {
            return mDismissStartTarget;
        } else {
            return mDismissEndTarget;
Loading