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

Commit 48a73a58 authored by Liran Binyamin's avatar Liran Binyamin
Browse files

Attempt to fix bubbles gesture pilfering

1. Remove bubble gesture monitor immediately when collapsing
2. Verify we're still attached when continuing to collapse
   after the IME was hidden; log if we're detached
3. Clear the IME hidden runnable when removing views from window
   manager

Fixes: 424528947
Bug: 423052244
Flag: EXEMPT bug fix
Test: manual -- this is hard to repro so just test normal behavior
       - verify that IME and bubbles functionality works
       - verify swipe up gesture works when bubbles expanded and
         collapsed
Change-Id: Icdfab0631c1197cb941ad5fc69d59ff855a4e2ad
parent 8d4dc014
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1166,6 +1166,10 @@ public class BubbleController implements ConfigurationChangeListener,
            }
        });
        try {
            if (mOnImeHidden != null) {
                Log.w(TAG, "removing bubbles from window manager with non-null onImeHidden");
            }
            mOnImeHidden = null;
            if (mStackView != null) {
                mWindowManager.removeView(mStackView);
                mBubbleData.getOverflow().cleanUpExpandedState();
+10 −1
Original line number Diff line number Diff line
@@ -2393,13 +2393,22 @@ public class BubbleStackView extends FrameLayout

        boolean wasExpanded = mIsExpanded;

        if (wasExpanded) {
            // stop monitoring gestures without waiting for the IME to hide if we're collapsing in
            // case the IME gets hidden after we already were detached from the window.
            stopMonitoringSwipeUpGesture();
        }

        // Do the actual expansion/collapse after the IME is hidden if it's currently visible in
        // order to avoid flickers
        // TODO: b/424812643 - clean up the onImeHidden runnable
        Runnable onImeHidden = () -> {
            if (!isAttachedToWindow()) {
                Log.w(TAG, "onImeHidden runnable running but we're not attached.");
            }
            mSysuiProxyProvider.getSysuiProxy().onStackExpandChanged(shouldExpand);

            if (wasExpanded) {
                stopMonitoringSwipeUpGesture();
                animateCollapse();
                showManageMenu(false);
                logBubbleEvent(mExpandedBubble,