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

Commit a8b20748 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Cancel recents animation when touch home key" into tm-dev

parents 9d093cad d275b6b5
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -243,10 +243,15 @@ public class RemoteTransitionCompat implements Parcelable {
        boolean merge(TransitionInfo info, SurfaceControl.Transaction t,
                RecentsAnimationListener recents) {
            ArrayList<TransitionInfo.Change> openingTasks = null;
            boolean cancelRecents = false;
            for (int i = info.getChanges().size() - 1; i >= 0; --i) {
                final TransitionInfo.Change change = info.getChanges().get(i);
                if (change.getMode() == TRANSIT_OPEN || change.getMode() == TRANSIT_TO_FRONT) {
                    if (change.getTaskInfo() != null) {
                        if (change.getTaskInfo().topActivityType == ACTIVITY_TYPE_HOME) {
                            // canceling recents animation
                            cancelRecents = true;
                        }
                        if (openingTasks == null) {
                            openingTasks = new ArrayList<>();
                        }
@@ -256,11 +261,13 @@ public class RemoteTransitionCompat implements Parcelable {
            }
            if (openingTasks == null) return false;
            int pauseMatches = 0;
            if (!cancelRecents) {
                for (int i = 0; i < openingTasks.size(); ++i) {
                    if (mPausingTasks.contains(openingTasks.get(i).getContainer())) {
                        ++pauseMatches;
                    }
                }
            }
            if (pauseMatches > 0) {
                if (pauseMatches != mPausingTasks.size()) {
                    // We are not really "returning" properly... something went wrong.