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

Commit 1eb9baa4 authored by Yabin Huang's avatar Yabin Huang
Browse files

Update IMMI#updateImeWindowStatus() to take display ID

To support multi-session IME, IMMI needs to know the window
ID of the IME. So this CL gets the window ID from the 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: Ie8a0315f4ecb421916ea4b68427acd1e7e5ff280
parent ace8b54a
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -156,8 +156,11 @@ public abstract class InputMethodManagerInternal {
     * Updates the IME visibility, back disposition and show IME picker status for SystemUI.
     * TODO(b/189923292): Making SystemUI to be true IME icon controller vs. presenter that
     * controlled by IMMS.
     *
     * @param disableImeIcon indicates whether IME icon should be enabled or not
     * @param displayId      the display for which to update the IME window status
     */
    public abstract void updateImeWindowStatus(boolean disableImeIcon);
    public abstract void updateImeWindowStatus(boolean disableImeIcon, int displayId);

    /**
     * Finish stylus handwriting by calling {@link InputMethodService#finishStylusHandwriting()} if
@@ -264,7 +267,7 @@ public abstract class InputMethodManagerInternal {
                }

                @Override
                public void updateImeWindowStatus(boolean disableImeIcon) {
                public void updateImeWindowStatus(boolean disableImeIcon, int displayId) {
                }

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

        @Override
        public void updateImeWindowStatus(boolean disableImeIcon) {
        public void updateImeWindowStatus(boolean disableImeIcon, int displayId) {
            mHandler.obtainMessage(MSG_UPDATE_IME_WINDOW_STATUS, disableImeIcon ? 1 : 0, 0)
                    .sendToTarget();
        }
+1 −1
Original line number Diff line number Diff line
@@ -455,7 +455,7 @@ final class InputMonitor {
                        // in animating before the next app window focused, or IME icon
                        // persists on the bottom when swiping the task to recents.
                        InputMethodManagerInternal.get().updateImeWindowStatus(
                                true /* disableImeIcon */);
                                true /* disableImeIcon */, mDisplayContent.getDisplayId());
                    }
                }
                return;
+2 −1
Original line number Diff line number Diff line
@@ -240,7 +240,8 @@ class KeyguardController {
        // state when evaluating visibilities.
        updateKeyguardSleepToken();
        mRootWindowContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS);
        InputMethodManagerInternal.get().updateImeWindowStatus(false /* disableImeIcon */);
        InputMethodManagerInternal.get().updateImeWindowStatus(false /* disableImeIcon */,
                displayId);
        setWakeTransitionReady();
        if (aodChanged) {
            // Ensure the new state takes effect.
+2 −1
Original line number Diff line number Diff line
@@ -967,7 +967,8 @@ public class RecentsAnimationController implements DeathRecipient {
        // Restore IME icon only when moving the original app task to front from recents, in case
        // IME icon may missing if the moving task has already been the current focused task.
        if (reorderMode == REORDER_MOVE_TO_ORIGINAL_POSITION && !mIsAddingTaskToTargets) {
            InputMethodManagerInternal.get().updateImeWindowStatus(false /* disableImeIcon */);
            InputMethodManagerInternal.get().updateImeWindowStatus(
                    false /* disableImeIcon */, mDisplayId);
        }

        // Update the input windows after the animation is complete
Loading