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

Skip to content
Commit 5f43140e authored by Johannes Gallmann's avatar Johannes Gallmann
Browse files

Fix app callback broken when immediately restarting back gesture after cancel

This fixes two bugs:
1. When calling onBackStarted, we need to ensure that onBackCancelled of a potential previously cancelled gesture is called first. onBackCancelled can be delayed because the progress animates to 0 before the callback is invoked. Otherwise onBackStarted of the second gesture can be called before onBackCancelled of the first gesture is called.
2. The BackTouchTracker should be reset when the user gesture ends (instead of when BackProgressAnimator finished animating the progress back to 0). That ensures that a new gesture that starts between the gesture end and the progress reaching zero does not update the BackProgressAnimator of the previous (cancelled) gesture with new MotionEvents.

Bug: 338021694
Flag: NONE
Test: atest FrameworksCoreTests:WindowOnBackInvokedDispatcherTest
Test: Manual, i.e. verifying that onBackCancelled is dispatched before onBackStarted when immediately restarting back gesture
Change-Id: Ibe3ce291713dc5ba0512404fa47f6b17d50f7a13
parent 02aea3b1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment