Loading services/core/java/com/android/server/wm/ActivityRecord.java +4 −3 Original line number Diff line number Diff line Loading @@ -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()); } Loading services/core/java/com/android/server/wm/TransitionController.java +25 −13 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -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 Loading @@ -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) { Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +4 −3 Original line number Diff line number Diff line Loading @@ -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()); } Loading
services/core/java/com/android/server/wm/TransitionController.java +25 −13 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -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 Loading @@ -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) { Loading