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

Commit 588c4ad4 authored by Johannes Gallmann's avatar Johannes Gallmann Committed by Android Build Coastguard Worker
Browse files

Prevent dispatching onBackStarted too early for gesture nav

Bug: 383527784
Flag: EXEMPT bugfix
Test: Manual, i.e. testing touches and long clicks in apps at screen edge on screens with predictive back system animations
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c7a24c3d9f85c68d720260a6d4892c18a3a047c8)
Merged-In: Ie596e2a39bfae6db2a574552999f5f128d4aa665
Change-Id: Ie596e2a39bfae6db2a574552999f5f128d4aa665
parent dfab7ad9
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -1106,13 +1106,15 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont
            mCurrentTracker.updateStartLocation();
            BackMotionEvent startEvent = mCurrentTracker.createStartEvent(mApps[0]);
            dispatchOnBackStarted(mActiveCallback, startEvent);
            if (startEvent.getSwipeEdge() == EDGE_NONE) {
                // TODO(b/373544911): onBackStarted is dispatched here so that
            //  WindowOnBackInvokedDispatcher knows about the back navigation and intercepts touch
            //  events while it's active. It would be cleaner and safer to disable multitouch
            //  altogether (same as in gesture-nav).
                //  WindowOnBackInvokedDispatcher knows about the back navigation and intercepts
                //  touch events while it's active. It would be cleaner and safer to disable
                //  multitouch altogether (same as in gesture-nav).
                dispatchOnBackStarted(mBackNavigationInfo.getOnBackInvokedCallback(), startEvent);
            }
        }
    }

    private void requestTopUi(boolean hasTopUi, int backType) {
        if (mRequestTopUiCallback != null && (backType == BackNavigationInfo.TYPE_CROSS_TASK