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

Commit 0c09232b authored by Yabin Huang's avatar Yabin Huang
Browse files

Update IMMI#onImeParentChanged() to take the display ID

To support multi-session IME, IMMI needs to know the display hosting
the IME window. So this CL gets the display ID from DisplayContent,
and passes it to IMMI.

This CL just passes an unused parameter to IMMS. It doesn't change
the behavior of the code, thus no flag is required. The passed
parameter will be used by another CL to implement the multi-session
IME, and that CL will be protected by the concurrent_input_methods
feature flag.

Bug: 305829876
Test: atest WmTests && atest FrameworksServicesTests
Change-Id: Ifbfe231102585021d9835760c4a2b742d8e5c027
parent 029cac40
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -167,8 +167,10 @@ public abstract class InputMethodManagerInternal {


    /**
    /**
     * Indicates that the IME window has re-parented to the new target when the IME control changed.
     * Indicates that the IME window has re-parented to the new target when the IME control changed.
     *
     * @param displayId the display hosting the IME window
     */
     */
    public abstract void onImeParentChanged();
    public abstract void onImeParentChanged(int displayId);


    /**
    /**
     * Destroys the IME surface.
     * Destroys the IME surface.
@@ -288,7 +290,7 @@ public abstract class InputMethodManagerInternal {
                }
                }


                @Override
                @Override
                public void onImeParentChanged() {
                public void onImeParentChanged(int displayId) {
                }
                }


                @Override
                @Override
+1 −1
Original line number Original line Diff line number Diff line
@@ -5671,7 +5671,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
        }
        }


        @Override
        @Override
        public void onImeParentChanged() {
        public void onImeParentChanged(int displayId) {
            synchronized (ImfLock.class) {
            synchronized (ImfLock.class) {
                // Hide the IME method menu only when the IME surface parent is changed by the
                // Hide the IME method menu only when the IME surface parent is changed by the
                // input target changed, in case seeing the dialog dismiss flickering during
                // input target changed, in case seeing the dialog dismiss flickering during
+2 −1
Original line number Original line Diff line number Diff line
@@ -4769,7 +4769,8 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
            assignRelativeLayerForIme(getSyncTransaction(), true /* forceUpdate */);
            assignRelativeLayerForIme(getSyncTransaction(), true /* forceUpdate */);
            scheduleAnimation();
            scheduleAnimation();


            mWmService.mH.post(() -> InputMethodManagerInternal.get().onImeParentChanged());
            mWmService.mH.post(
                    () -> InputMethodManagerInternal.get().onImeParentChanged(getDisplayId()));
        } else if (mImeControlTarget != null && mImeControlTarget == mImeLayeringTarget) {
        } else if (mImeControlTarget != null && mImeControlTarget == mImeLayeringTarget) {
            // Even if the IME surface parent is not changed, the layer target belonging to the
            // Even if the IME surface parent is not changed, the layer target belonging to the
            // parent may have changes. Then attempt to reassign if the IME control target is
            // parent may have changes. Then attempt to reassign if the IME control target is