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

Commit fb11a827 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Automerger Merge Worker
Browse files

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16983284

Change-Id: I8de5b69198d3209fde1872873317086b834d72d8
parents 2cb19af8 a8b20748
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.