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

Commit c12199f4 authored by Joshua Tsuji's avatar Joshua Tsuji Committed by Josh Tsuji
Browse files

Fix obscured touchable region code.

This fixes the issue where bubbles are untouchable after being opened from the shade, as well as issues with the animation CL.

The root cause here was that the obscured touchable region is only updated after an explicit call to ActivityView.onLocationChanged(). We were only calling this when the Bubble initially expanded, and at that point, the notification shade was expanded, so we set the touchable region to empty. When the shade collapses, the AV's onLocationChanged() is never called again, so the touchable region remains empty.

Fixing this is actually very easy - we originally needed to empty the touchable region when the shade was expanded because we were in its window (and didn't want to steal its touches). Now that we are in our own window, we don't need to worry about that, so the shade check can be deleted entirely.

This also adds a check for mExpanded = false, since a collapsed stack should never be able to dispatch touch events to the AV.

Test: expand bubbs from shade
Fixes: 157756567
Change-Id: I8350670f34660f6b725904309c5d6c70abb8a33e
parent b1215125
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -617,7 +617,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
        if (mStackView == null) {
            mStackView = new BubbleStackView(
                    mContext, mBubbleData, mSurfaceSynchronizer, mFloatingContentCoordinator,
                    mSysUiState, mNotificationShadeWindowController, this::onAllBubblesAnimatedOut,
                    mSysUiState, this::onAllBubblesAnimatedOut,
                    this::onImeVisibilityChanged);
            mStackView.addView(mBubbleScrim);
            if (mExpandListener != null) {
+1 −5
Original line number Diff line number Diff line
@@ -348,8 +348,6 @@ public class BubbleStackView extends FrameLayout
    @NonNull
    private final SurfaceSynchronizer mSurfaceSynchronizer;

    private final NotificationShadeWindowController mNotificationShadeWindowController;

    /**
     * Callback to run when the IME visibility changes - BubbleController uses this to update the
     * Bubbles window focusability flags with the WindowManager.
@@ -682,7 +680,6 @@ public class BubbleStackView extends FrameLayout
            @Nullable SurfaceSynchronizer synchronizer,
            FloatingContentCoordinator floatingContentCoordinator,
            SysUiState sysUiState,
            NotificationShadeWindowController notificationShadeWindowController,
            Runnable allBubblesAnimatedOutAction,
            Consumer<Boolean> onImeVisibilityChanged) {
        super(context);
@@ -691,7 +688,6 @@ public class BubbleStackView extends FrameLayout
        mInflater = LayoutInflater.from(context);

        mSysUiState = sysUiState;
        mNotificationShadeWindowController = notificationShadeWindowController;

        Resources res = getResources();
        mMaxBubbles = res.getInteger(R.integer.bubbles_max_rendered);
@@ -1802,7 +1798,7 @@ public class BubbleStackView extends FrameLayout
    public void subtractObscuredTouchableRegion(Region touchableRegion, View view) {
        // If the notification shade is expanded, or the manage menu is open, we shouldn't let the
        // ActivityView steal any touch events from any location.
        if (mNotificationShadeWindowController.getPanelExpanded() || mShowingManage) {
        if (!mIsExpanded || mShowingManage) {
            touchableRegion.setEmpty();
        }
    }