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

Commit 15b0f2fb authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Only notify prepare-surface callback from window animator" into main

parents b625effb 502e6361
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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);

+3 −3
Original line number Diff line number Diff line
@@ -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);
+13 −0
Original line number Diff line number Diff line
@@ -1053,6 +1053,19 @@ class WindowTestsBase extends SystemServiceTestsBase {
        displayRotation.configure(dc.mBaseDisplayWidth, dc.mBaseDisplayHeight);
    }

    /**
     * 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).