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

Commit f6d48701 authored by Johannes Gallmann's avatar Johannes Gallmann
Browse files

Disable velocity-slowdown when timestamp API is enabled

When the timestamp API is enabled, apps should calculate and handle the velocity themselves. Therefore the velocity-slowdown logic is disabled.

if we would keep playing the slow-down, the velocity would always be 0 when apps receive onBackInvoked.

Bug: 362938401
Test: Manual, i.e. verify that velocity-slow down is not played anymore but onBackInvoked is called immediately when the back gesture is released.
Flag: com.android.window.flags.predictive_back_timestamp_api
Change-Id: I426ba2a8294961849f189b21a843e6622b014586
parent e0facd90
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.window;

import static com.android.window.flags.Flags.predictiveBackPrioritySystemNavigationObserver;
import static com.android.window.flags.Flags.predictiveBackTimestampApi;

import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -563,7 +564,8 @@ public class WindowOnBackInvokedDispatcher implements OnBackInvokedDispatcher {
                }
                OnBackAnimationCallback animationCallback = getBackAnimationCallback();
                if (animationCallback != null
                        && !(callback instanceof ImeBackAnimationController)) {
                        && !(callback instanceof ImeBackAnimationController)
                        && !predictiveBackTimestampApi()) {
                    mProgressAnimator.onBackInvoked(() -> {
                        if (mIsSystemCallback) {
                            mSystemNavigationObserverCallbackRunnable.run();