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

Commit 78864fa2 authored by Andreas Miko's avatar Andreas Miko
Browse files

Fix touchable area after shade is gone in Flexiglass

After transitioning away from the Shade or QS the touches on all other
scenes were not registering anymore.

Test: NONE
Bug: b/309861158
Flag: NONE
Change-Id: Iffe08cd9ee298c0eb0c7b5babc4937755cce647e
parent 204f79c0
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();