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

Commit 59e9754a authored by wilsonshih's avatar wilsonshih
Browse files

Clear un-sent pending animation if back gesture is complete finished.

Shell could finish back gesture before pending animation start. Clear
the original pending animation in case it being sent accidentally.
Also setLaunchBehind doesn't need to call setVisibility, since there
already calls commitVisibility. This also the reason where perform
surface placement unexpected occur during prepare animation.

Bug: 319293406
Bug: 319293969
Test: simulate calls onBackNavigationDone before pending animation
start, verify previous pending animation won't be triggerred while
start second back navigation again.

Change-Id: I28867f91b0095b23c377d5fbd2e2fb2add39f9c3
parent de0a2c47
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -1591,7 +1591,6 @@ class BackNavigationController {

    private static void setLaunchBehind(@NonNull ActivityRecord activity) {
        if (!activity.isVisibleRequested()) {
            activity.setVisibility(true);
            // The transition could commit the visibility and in the finishing state, that could
            // skip commitVisibility call in setVisibility cause the activity won't visible here.
            // Call it again to make sure the activity could be visible while handling the pending
@@ -1669,11 +1668,15 @@ class BackNavigationController {
        ProtoLog.d(WM_DEBUG_BACK_PREVIEW, "onBackNavigationDone backType=%s, "
                + "triggerBack=%b", backType, triggerBack);

        synchronized (mWindowManagerService.mGlobalLock) {
            mNavigationMonitor.stopMonitorForRemote();
            mBackAnimationInProgress = false;
            mShowWallpaper = false;
            // All animation should be done, clear any un-send animation.
            mPendingAnimation = null;
            mPendingAnimationBuilder = null;
        }
    }

    static TaskSnapshot getSnapshot(@NonNull WindowContainer w,
            ActivityRecord[] visibleOpenActivities) {