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

Commit 55e33b03 authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Fix incorrect dispatch of empty WindowInsets from...

Merge "Fix incorrect dispatch of empty WindowInsets from ActionBarOverlayLayout" into lmp-preview-dev
parents a5d80b39 720924b6
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -46,7 +46,13 @@ public final class WindowInsets {
     * since it would allow them to inadvertently consume unknown insets by returning it.
     * @hide
     */
    public static final WindowInsets EMPTY = new WindowInsets(EMPTY_RECT, EMPTY_RECT);
    public static final WindowInsets CONSUMED;

    static {
        CONSUMED = new WindowInsets(EMPTY_RECT, EMPTY_RECT);
        CONSUMED.mSystemWindowInsetsConsumed = true;
        CONSUMED.mWindowDecorInsetsConsumed = true;
    }

    /** @hide */
    public WindowInsets(Rect systemWindowInsets, Rect windowDecorInsets) {
+9 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
@@ -245,6 +246,13 @@ public class ActionBarOverlayLayout extends ViewGroup implements DecorContentPar
        }
    }

    @Override
    protected void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        init(getContext());
        requestApplyInsets();
    }

    @Override
    public void onWindowSystemUiVisibilityChanged(int visible) {
        super.onWindowSystemUiVisibilityChanged(visible);
@@ -329,7 +337,7 @@ public class ActionBarOverlayLayout extends ViewGroup implements DecorContentPar
        // insets in all cases, we need to know the measured size of the various action
        // bar elements.  onApplyWindowInsets() happens before the measure pass, so we can't
        // do that here.  Instead we will take this up in onMeasure().
        return WindowInsets.EMPTY;
        return WindowInsets.CONSUMED;
    }

    @Override