From ffad14c9638381fb8611c0657bdfd7882acda5cf Mon Sep 17 00:00:00 2001 From: Johannes Gallmann Date: Wed, 12 Mar 2025 15:12:49 +0000 Subject: Fix BackAnimationController race condition This CL fixes a race condition in BackAnimationController. Since onThresholdCrossed is not executed on the shell main thread, the ordering between other BackAnimation API function calls was not guaranteed. Namely, onThresholdCrossed could have been executed before the first MOVE event was processed, resulting in startBackAnimation not being called. In that case, BackAnimationController injected legacy back events as a fallback instead of playing the predictive back animation. Executing onThresholdCrossed on the shell main thread instead should resolve this problem. Additionally, the recently implemented small related change (commit 13423234d99327cf16fec9ac76b8bd116a586b26) in EBGH is put behind the predictiveBackDelayWmTransition flag as well. Bug: 401832380 Flag: com.android.systemui.predictive_back_delay_wm_transition Test: BackGestureInvokedTest Change-Id: I77d0d1de66934754cc64330130d4bd34b4634796 --- .../src/com/android/wm/shell/back/BackAnimationController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java index 53dede6bd227..5d59af940da0 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java @@ -332,7 +332,11 @@ public class BackAnimationController implements RemoteCallable