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

Commit ec820a85 authored by Andreas Miko's avatar Andreas Miko Committed by Android (Google) Code Review
Browse files

Merge "Fix touchable area after shade is gone in Flexiglass" into main

parents edb14a70 78864fa2
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
    private final UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;

    private boolean mIsStatusBarExpanded = false;
    private boolean mIsSceneContainerVisible = false;
    private boolean mShouldAdjustInsets = false;
    private View mNotificationShadeWindowView;
    private View mNotificationPanelView;
@@ -128,11 +129,14 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
        });

        mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController;
        javaAdapter.alwaysCollectFlow(shadeInteractor.isAnyExpanded(), this::onShadeOrQsExpanded);

        if (sceneContainerFlags.isEnabled()) {
            javaAdapter.alwaysCollectFlow(
                    sceneInteractor.get().isVisible(),
                    this::onSceneContainerVisibilityChanged);
        } else {
            javaAdapter.alwaysCollectFlow(
                    shadeInteractor.isAnyExpanded(),
                    this::onShadeOrQsExpanded);
        }

@@ -164,6 +168,17 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
        }
    }

    private void onSceneContainerVisibilityChanged(Boolean isVisible) {
        if (isVisible != mIsSceneContainerVisible) {
            mIsSceneContainerVisible = isVisible;
            if (isVisible) {
                // make sure our state is sensible
                mForceCollapsedUntilLayout = false;
            }
            updateTouchableRegion();
        }
    }

    /**
     * Calculates the touch region needed for heads up notifications, taking into consideration
     * any existing display cutouts (notch)
@@ -267,6 +282,7 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
        // since we don't want stray touches to go through the light reveal scrim to whatever is
        // underneath.
        return mIsStatusBarExpanded
                || mIsSceneContainerVisible
                || mPrimaryBouncerInteractor.isShowing().getValue()
                || mAlternateBouncerInteractor.isVisibleState()
                || mUnlockedScreenOffAnimationController.isAnimationPlaying();