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

Commit a3a1e8ad authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Prevent early onEnterAnimationComplete callback for recents target" into pi-dev

parents 5513302b 0bb66ccc
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -405,6 +405,14 @@ public class RecentsAnimationController implements DeathRecipient {
        // Clear associated input consumers
        mService.mInputMonitor.updateInputWindowsLw(true /*force*/);
        mService.destroyInputConsumer(INPUT_CONSUMER_RECENTS_ANIMATION);

        // We have deferred all notifications to the target app as a part of the recents animation,
        // so if we are actually transitioning there, notify again here
        if (mTargetAppToken != null) {
            if (reorderMode == REORDER_MOVE_TO_TOP || reorderMode == REORDER_KEEP_IN_PLACE) {
                mService.mAppTransition.notifyAppTransitionFinishedLocked(mTargetAppToken.token);
            }
        }
    }

    void scheduleFailsafe() {
@@ -469,6 +477,10 @@ public class RecentsAnimationController implements DeathRecipient {
        return false;
    }

    boolean isTargetApp(AppWindowToken token) {
        return mTargetAppToken != null && token == mTargetAppToken;
    }

    private boolean isTargetOverWallpaper() {
        if (mTargetAppToken == null) {
            return false;
+13 −4
Original line number Diff line number Diff line
@@ -864,6 +864,14 @@ public class WindowManagerService extends IWindowManager.Stub
            } else {
                atoken.updateReportedVisibilityLocked();
                if (atoken.mEnteringAnimation) {
                    if (getRecentsAnimationController() != null
                            && getRecentsAnimationController().isTargetApp(atoken)) {
                        // Currently running a recents animation, this will get called early because
                        // we show the recents animation target activity immediately when the
                        // animation starts. In this case, we should defer sending the finished
                        // callback until the animation successfully finishes
                        return;
                    } else {
                        atoken.mEnteringAnimation = false;
                        try {
                            mActivityManager.notifyEnterAnimationComplete(atoken.token);
@@ -872,6 +880,7 @@ public class WindowManagerService extends IWindowManager.Stub
                    }
                }
            }
        }
    };

    final ArrayList<AppFreezeListener> mAppFreezeListeners = new ArrayList<>();