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

Commit f3258931 authored by Evan Rosky's avatar Evan Rosky Committed by Automerger Merge Worker
Browse files

Merge "Only prevent non-default colormode show during playing" into tm-qpr-dev am: b8733e42

parents ada74df7 b8733e42
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -4450,14 +4450,15 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

    /**
     * @return Whether we are allowed to show non-starting windows at the moment. We disallow
     *         showing windows during transitions in case we have windows that have wide-color-gamut
     *         color mode set to avoid jank in the middle of the transition.
     *         showing windows while the transition animation is playing in case we have windows
     *         that have wide-color-gamut color mode set to avoid jank in the middle of the
     *         animation.
     */
    boolean canShowWindows() {
        final boolean drawn = mTransitionController.isShellTransitionsEnabled()
                ? mSyncState != SYNC_STATE_WAITING_FOR_DRAW : allDrawn;
        final boolean animating = mTransitionController.isShellTransitionsEnabled()
                ? mTransitionController.inTransition(this)
                ? mTransitionController.inPlayingTransition(this)
                : isAnimating(PARENTS, ANIMATION_TYPE_APP_TRANSITION);
        return drawn && !(animating && hasNonDefaultColorWindow());
    }
+25 −13
Original line number Diff line number Diff line
@@ -206,6 +206,18 @@ class TransitionController {
        return mCollectingTransition != null && mCollectingTransition.mParticipants.contains(wc);
    }

    /**
     * @return {@code true} if transition is actively collecting changes and `wc` is one of them
     *                      or a descendant of one of them. {@code false} once playing.
     */
    boolean inCollectingTransition(@NonNull WindowContainer wc) {
        if (!isCollecting()) return false;
        for (WindowContainer p = wc; p != null; p = p.getParent()) {
            if (mCollectingTransition.mParticipants.contains(p)) return true;
        }
        return false;
    }

    /**
     * @return {@code true} if transition is actively playing. This is not necessarily {@code true}
     * during collection.
@@ -214,6 +226,18 @@ class TransitionController {
        return !mPlayingTransitions.isEmpty();
    }

    /**
     * @return {@code true} if one of the playing transitions contains `wc`.
     */
    boolean inPlayingTransition(@NonNull WindowContainer wc) {
        for (int i = mPlayingTransitions.size() - 1; i >= 0; --i) {
            for (WindowContainer p = wc; p != null; p = p.getParent()) {
                if (mPlayingTransitions.get(i).mParticipants.contains(p)) return true;
            }
        }
        return false;
    }

    /** @return {@code true} if a transition is running */
    boolean inTransition() {
        // TODO(shell-transitions): eventually properly support multiple
@@ -222,19 +246,7 @@ class TransitionController {

    /** @return {@code true} if a transition is running in a participant subtree of wc */
    boolean inTransition(@NonNull WindowContainer wc) {
        if (isCollecting()) {
            for (WindowContainer p = wc; p != null; p = p.getParent()) {
                if (isCollecting(p)) return true;
            }
        }
        for (int i = mPlayingTransitions.size() - 1; i >= 0; --i) {
            for (WindowContainer p = wc; p != null; p = p.getParent()) {
                if (mPlayingTransitions.get(i).mParticipants.contains(p)) {
                    return true;
                }
            }
        }
        return false;
        return inCollectingTransition(wc) || inPlayingTransition(wc);
    }

    boolean inRecentsTransition(@NonNull WindowContainer wc) {