Fixes rotation stuck in core without trigger transition.

If there exists a Open transition for an app and display was involved,
update rotation will not start any rotation neither startRemoteRotation
or requestTransition because there will add the display to sync group,
and since there never send any rotation-related signal to shell, the
display will never sync ready because the system decorations won't know
there should be an configuration change.
There should check isCollecting so it can fallback to
startRemoteRotation.

Test: enable shell transition, run atest TaplTestsLauncher3
Bug: 207297486
Change-Id: Ic710c44a158c3522a0b3e5cbee7d6b1a4c7e4bda
This commit is contained in:
wilsonshih
2021-12-03 10:42:41 +08:00
parent 6a13e152ed
commit a6ff530c35

View File

@@ -508,10 +508,10 @@ public class DisplayRotation {
mDisplayContent.setLayoutNeeded();
if (useShellTransitions) {
final boolean wasInTransition = mDisplayContent.inTransition();
final boolean wasCollecting = mDisplayContent.mTransitionController.isCollecting();
mDisplayContent.requestChangeTransitionIfNeeded(
ActivityInfo.CONFIG_WINDOW_CONFIGURATION);
if (wasInTransition) {
if (wasCollecting) {
// Use remote-rotation infra since the transition has already been requested
// TODO(shell-transitions): Remove this once lifecycle management can cover all
// rotation cases.