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

Commit d7ad4d5d authored by Alex Chau's avatar Alex Chau Committed by Android (Google) Code Review
Browse files

Merge "Reapply insets normalization on configuration changes" into main

parents ba8b4d78 579a7851
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@ import android.view.ViewDebug;
import android.view.WindowInsets;

import com.android.launcher3.graphics.SysUiScrim;
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.statemanager.StatefulContainer;
import com.android.launcher3.util.window.WindowManagerProxy;

@@ -56,7 +55,10 @@ public class LauncherRootView extends InsettableFrameLayout {
    public WindowInsets onApplyWindowInsets(WindowInsets insets) {
        mStatefulContainer.handleConfigurationChanged(
                mStatefulContainer.getContext().getResources().getConfiguration());
        return updateInsets(insets);
    }

    private WindowInsets updateInsets(WindowInsets insets) {
        insets = WindowManagerProxy.INSTANCE.get(getContext())
                .normalizeWindowInsets(getContext(), insets, mTempRect);
        handleSystemWindowInsets(mTempRect);
@@ -74,7 +76,11 @@ public class LauncherRootView extends InsettableFrameLayout {
    }

    public void dispatchInsets() {
        if (isAttachedToWindow()) {
            updateInsets(getRootWindowInsets());
        } else {
            mStatefulContainer.getDeviceProfile().updateInsets(mInsets);
        }
        super.setInsets(mInsets);
    }