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

Commit 0e9155e2 authored by Felix Stern's avatar Felix Stern
Browse files

Set IME showing in ImeInsetsSourceProvider#onPostLayout

The snapshot logic relies on the information about the IME being shown or not. In the initial refactor, this was not correctly set which led to the IME snapshot not being shown.

Test: atest FlickerTestsIme3:com.android.server.wm.flicker.ime.ShowImeOnUnlockScreenTest#imeAndAppAnimateTogetherWhenLockingAndUnlocking
Flag: android.view.inputmethod.refactor_insets_controller
Fix: 355052042
Change-Id: I118749534c824f1f375f3aa43d2fa5b13e0c3222
parent 4c347ab6
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -5081,9 +5081,11 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
            Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
        }

        if (!android.view.inputmethod.Flags.refactorInsetsController()) {
            // This should be called after the insets have been dispatched to clients and we have
            // committed finish drawing windows.
            mInsetsStateController.getImeSourceProvider().checkAndStartShowImePostLayout();
        }

        mLastHasContent = mTmpApplySurfaceChangesTransactionState.displayHasContent;
        if (!inTransition() && !mDisplayRotation.isRotatingSeamlessly()) {
+3 −0
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@ final class ImeInsetsSourceProvider extends InsetsSourceProvider {
                ImeTracker.forLogging().onProgress(mStatsToken,
                        ImeTracker.PHASE_WM_POST_LAYOUT_NOTIFY_CONTROLS_CHANGED);
                mStateController.notifyControlChanged(mControlTarget);
                setImeShowing(true);
            } else if (wasServerVisible && mServerVisible && mGivenInsetsReady
                    && givenInsetsPending) {
                // If the server visibility didn't change (still visible), and mGivenInsetsReady
@@ -113,6 +114,8 @@ final class ImeInsetsSourceProvider extends InsetsSourceProvider {
                ImeTracker.forLogging().onCancelled(mStatsToken,
                        ImeTracker.PHASE_WM_POST_LAYOUT_NOTIFY_CONTROLS_CHANGED);
                mStatsToken = null;
            } else if (wasServerVisible && !mServerVisible) {
                setImeShowing(false);
            }
        }
    }