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

Commit bf4bd063 authored by wilsonshih's avatar wilsonshih
Browse files

[PB] Pilfer pointers if no focus window.

startBackNavigation can return null if no focus window, which can happen
if a transition is playing. We should still pilfer pointers in case the
touch event send to app once it become focused.

Flag: EXEMPT bugfix
Bug: 351763151
Test: trigger gesture right after transition, verify app won't receive
motion event.

Change-Id: I535085561ebc56e24672b859859587da349da6e8
parent 6eee3cab
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -422,6 +422,12 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont
    @VisibleForTesting
    public void onThresholdCrossed() {
        mThresholdCrossed = true;
        // There was no focus window when calling startBackNavigation, still pilfer pointers so
        // the next focus window won't receive motion events.
        if (mBackNavigationInfo == null) {
            tryPilferPointers();
            return;
        }
        // Dispatch onBackStarted, only to app callbacks.
        // System callbacks will receive onBackStarted when the remote animation starts.
        final boolean shouldDispatchToAnimator = shouldDispatchToAnimator();
@@ -542,6 +548,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont
        if (backNavigationInfo == null) {
            ProtoLog.e(WM_SHELL_BACK_PREVIEW, "Received BackNavigationInfo is null.");
            cancelLatencyTracking();
            tryPilferPointers();
            return;
        }
        final int backType = backNavigationInfo.getType();