Loading services/core/java/com/android/server/wm/Transition.java +3 −0 Original line number Diff line number Diff line Loading @@ -1127,6 +1127,9 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener { // though, notify the controller to prevent degenerate cases. if (!r.isVisibleRequested()) { mController.mValidateCommitVis.add(r); } else { // Make sure onAppTransitionFinished can be notified. mParticipants.add(r); } return; } Loading services/core/java/com/android/server/wm/WindowToken.java +2 −1 Original line number Diff line number Diff line Loading @@ -519,7 +519,8 @@ class WindowToken extends WindowContainer<WindowState> { for (int i = mFixedRotationTransformState.mAssociatedTokens.size() - 1; i >= 0; i--) { final ActivityRecord r = mFixedRotationTransformState.mAssociatedTokens.get(i).asActivityRecord(); if (r != null && r.isInTransition()) { // Only care about the transition at Activity/Task level. if (r != null && r.inTransitionSelfOrParent() && !r.mDisplayContent.inTransition()) { return true; } } Loading services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +5 −2 Original line number Diff line number Diff line Loading @@ -1703,14 +1703,17 @@ public class DisplayContentTests extends WindowTestsBase { final Task task = app.getTask(); final ActivityRecord app2 = new ActivityBuilder(mWm.mAtmService).setTask(task).build(); mDisplayContent.setFixedRotationLaunchingApp(app2, (mDisplayContent.getRotation() + 1) % 4); doReturn(true).when(app).isInTransition(); doReturn(true).when(app).inTransitionSelfOrParent(); // If the task contains a transition, this should be no-op. mDisplayContent.mFixedRotationTransitionListener.onAppTransitionFinishedLocked(app.token); assertTrue(app2.hasFixedRotationTransform()); assertTrue(mDisplayContent.hasTopFixedRotationLaunchingApp()); doReturn(false).when(app).isInTransition(); // The display should be unlikely to be in transition, but if it happens, the fixed // rotation should proceed to finish because the activity/task level transition is finished. doReturn(true).when(mDisplayContent).inTransition(); doReturn(false).when(app).inTransitionSelfOrParent(); // Although this notifies app instead of app2 that uses the fixed rotation, app2 should // still finish the transform because there is no more transition event. mDisplayContent.mFixedRotationTransitionListener.onAppTransitionFinishedLocked(app.token); Loading Loading
services/core/java/com/android/server/wm/Transition.java +3 −0 Original line number Diff line number Diff line Loading @@ -1127,6 +1127,9 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener { // though, notify the controller to prevent degenerate cases. if (!r.isVisibleRequested()) { mController.mValidateCommitVis.add(r); } else { // Make sure onAppTransitionFinished can be notified. mParticipants.add(r); } return; } Loading
services/core/java/com/android/server/wm/WindowToken.java +2 −1 Original line number Diff line number Diff line Loading @@ -519,7 +519,8 @@ class WindowToken extends WindowContainer<WindowState> { for (int i = mFixedRotationTransformState.mAssociatedTokens.size() - 1; i >= 0; i--) { final ActivityRecord r = mFixedRotationTransformState.mAssociatedTokens.get(i).asActivityRecord(); if (r != null && r.isInTransition()) { // Only care about the transition at Activity/Task level. if (r != null && r.inTransitionSelfOrParent() && !r.mDisplayContent.inTransition()) { return true; } } Loading
services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +5 −2 Original line number Diff line number Diff line Loading @@ -1703,14 +1703,17 @@ public class DisplayContentTests extends WindowTestsBase { final Task task = app.getTask(); final ActivityRecord app2 = new ActivityBuilder(mWm.mAtmService).setTask(task).build(); mDisplayContent.setFixedRotationLaunchingApp(app2, (mDisplayContent.getRotation() + 1) % 4); doReturn(true).when(app).isInTransition(); doReturn(true).when(app).inTransitionSelfOrParent(); // If the task contains a transition, this should be no-op. mDisplayContent.mFixedRotationTransitionListener.onAppTransitionFinishedLocked(app.token); assertTrue(app2.hasFixedRotationTransform()); assertTrue(mDisplayContent.hasTopFixedRotationLaunchingApp()); doReturn(false).when(app).isInTransition(); // The display should be unlikely to be in transition, but if it happens, the fixed // rotation should proceed to finish because the activity/task level transition is finished. doReturn(true).when(mDisplayContent).inTransition(); doReturn(false).when(app).inTransitionSelfOrParent(); // Although this notifies app instead of app2 that uses the fixed rotation, app2 should // still finish the transform because there is no more transition event. mDisplayContent.mFixedRotationTransitionListener.onAppTransitionFinishedLocked(app.token); Loading