diff options
| author | 2024-01-12 06:32:02 +0000 | |
|---|---|---|
| committer | 2024-01-12 06:32:02 +0000 | |
| commit | 15b0f2fb61353ed2a14f5b67761f85c45ba0c1d4 (patch) | |
| tree | ad8bc30263735b9da470348307ebaf0e68324011 | |
| parent | b625effb50afdb11e7aa27edcbcba1e45dd7bb0a (diff) | |
| parent | 502e63611906e2e6b71cee31b6e0c7dfa8124a6a (diff) | |
Merge "Only notify prepare-surface callback from window animator" into main
3 files changed, 16 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java index 6033220e260d..02b3f15979ce 100644 --- a/services/core/java/com/android/server/wm/RootWindowContainer.java +++ b/services/core/java/com/android/server/wm/RootWindowContainer.java @@ -808,7 +808,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent> mWmService.mAtmService.mTaskOrganizerController.dispatchPendingEvents(); mWmService.mAtmService.mTaskFragmentOrganizerController.dispatchPendingEvents(); mWmService.mSyncEngine.onSurfacePlacement(); - mWmService.mAnimator.executeAfterPrepareSurfacesRunnables(); checkAppTransitionReady(surfacePlacer); diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java index f5282cb492f0..9bb2da0ff70c 100644 --- a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java @@ -3309,7 +3309,7 @@ public class ActivityRecordTests extends WindowTestsBase { // keyguard to back to the app, expect IME insets is not frozen app.mActivityRecord.commitVisibility(true, false); mDisplayContent.updateImeInputAndControlTarget(app); - mDisplayContent.mWmService.mRoot.performSurfacePlacement(); + performSurfacePlacementAndWaitForWindowAnimator(); assertFalse(app.mActivityRecord.mImeInsetsFrozenUntilStartInput); @@ -3358,7 +3358,7 @@ public class ActivityRecordTests extends WindowTestsBase { mDisplayContent.setImeLayeringTarget(app2); app2.mActivityRecord.commitVisibility(true, false); mDisplayContent.updateImeInputAndControlTarget(app2); - mDisplayContent.mWmService.mRoot.performSurfacePlacement(); + performSurfacePlacementAndWaitForWindowAnimator(); // Verify after unfreezing app2's IME insets state, we won't dispatch visible IME insets // to client if the app didn't request IME visible. @@ -3412,7 +3412,7 @@ public class ActivityRecordTests extends WindowTestsBase { // frozen until the input started. mDisplayContent.setImeLayeringTarget(app1); mDisplayContent.updateImeInputAndControlTarget(app1); - mDisplayContent.mWmService.mRoot.performSurfacePlacement(); + performSurfacePlacementAndWaitForWindowAnimator(); assertEquals(app1, mDisplayContent.getImeInputTarget()); assertFalse(activity1.mImeInsetsFrozenUntilStartInput); diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java index 60e84b03ec89..9c421ba29796 100644 --- a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java +++ b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java @@ -1054,6 +1054,19 @@ class WindowTestsBase extends SystemServiceTestsBase { } /** + * Performs surface placement and waits for WindowAnimator to complete the frame. It is used + * to execute the callbacks if the surface placement is expected to add some callbacks via + * {@link WindowAnimator#addAfterPrepareSurfacesRunnable}. + */ + void performSurfacePlacementAndWaitForWindowAnimator() { + mWm.mAnimator.ready(); + if (!mWm.mWindowPlacerLocked.isTraversalScheduled()) { + mRootWindowContainer.performSurfacePlacement(); + } + waitUntilWindowAnimatorIdle(); + } + + /** * Avoids rotating screen disturbed by some conditions. It is usually used for the default * display that is not the instance of {@link TestDisplayContent} (it bypasses the conditions). * |