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

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

Merge "Don't defer app transition if one of activity isn't one of recents."...

Merge "Don't defer app transition if one of activity isn't one of recents." into tm-qpr-dev am: 879b9a85 am: 1aa1320e

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



Change-Id: Ibb962ec95949cc22c2c267375ff392cff1475edf
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 9c18fea9 1aa1320e
Loading
Loading
Loading
Loading
+36 −15
Original line number Diff line number Diff line
@@ -176,6 +176,42 @@ public class AppTransitionController {
                || !transitionGoodToGoForTaskFragments()) {
            return;
        }
        final boolean isRecentsInOpening = mDisplayContent.mOpeningApps.stream().anyMatch(
                ConfigurationContainer::isActivityTypeRecents);
        // In order to avoid visual clutter caused by a conflict between app transition
        // animation and recents animation, app transition is delayed until recents finishes.
        // One exceptional case. When 3P launcher is used and a user taps a task screenshot in
        // task switcher (isRecentsInOpening=true), app transition must start even though
        // recents is running. Otherwise app transition is blocked until timeout (b/232984498).
        // When 1P launcher is used, this animation is controlled by the launcher outside of
        // the app transition, so delaying app transition doesn't cause visible delay. After
        // recents finishes, app transition is handled just to commit visibility on apps.
        if (!isRecentsInOpening) {
            final ArraySet<WindowContainer> participants = new ArraySet<>();
            participants.addAll(mDisplayContent.mOpeningApps);
            participants.addAll(mDisplayContent.mChangingContainers);
            boolean deferForRecents = false;
            for (int i = 0; i < participants.size(); i++) {
                WindowContainer wc = participants.valueAt(i);
                final ActivityRecord activity = getAppFromContainer(wc);
                if (activity == null) {
                    continue;
                }
                // Don't defer recents animation if one of activity isn't running for it, that one
                // might be started from quickstep.
                if (!activity.isAnimating(PARENTS, ANIMATION_TYPE_RECENTS)) {
                    deferForRecents = false;
                    break;
                }
                deferForRecents = true;
            }
            if (deferForRecents) {
                ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
                        "Delaying app transition for recents animation to finish");
                return;
            }
        }

        Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "AppTransitionReady");

        ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "**** GOOD TO GO");
@@ -1241,27 +1277,12 @@ public class AppTransitionController {
                    "Delaying app transition for screen rotation animation to finish");
            return false;
        }
        final boolean isRecentsInOpening = mDisplayContent.mOpeningApps.stream().anyMatch(
                ConfigurationContainer::isActivityTypeRecents);
        for (int i = 0; i < apps.size(); i++) {
            WindowContainer wc = apps.valueAt(i);
            final ActivityRecord activity = getAppFromContainer(wc);
            if (activity == null) {
                continue;
            }
            // In order to avoid visual clutter caused by a conflict between app transition
            // animation and recents animation, app transition is delayed until recents finishes.
            // One exceptional case. When 3P launcher is used and a user taps a task screenshot in
            // task switcher (isRecentsInOpening=true), app transition must start even though
            // recents is running. Otherwise app transition is blocked until timeout (b/232984498).
            // When 1P launcher is used, this animation is controlled by the launcher outside of
            // the app transition, so delaying app transition doesn't cause visible delay. After
            // recents finishes, app transition is handled just to commit visibility on apps.
            if (!isRecentsInOpening && activity.isAnimating(PARENTS, ANIMATION_TYPE_RECENTS)) {
                ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
                        "Delaying app transition for recents animation to finish");
                return false;
            }
            ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
                    "Check opening app=%s: allDrawn=%b startingDisplayed=%b "
                            + "startingMoved=%b isRelaunching()=%b startingWindow=%s",