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

Commit ca6c981a authored by Antonio Kantek's avatar Antonio Kantek Committed by Android (Google) Code Review
Browse files

Merge "Retrieve the caller's selected method id in start input" into main

parents 4927c4ee a3402b18
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -2057,8 +2057,9 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.

        // Potentially override the selected input method if the new display belongs to a virtual
        // device with a custom IME.
        String selectedMethodId = getSelectedMethodIdLocked();
        final String deviceMethodId = computeCurrentDeviceMethodIdLocked(selectedMethodId);
        String selectedMethodId = bindingController.getSelectedMethodId();
        final String deviceMethodId = computeCurrentDeviceMethodIdLocked(bindingController.mUserId,
                selectedMethodId);
        if (deviceMethodId == null) {
            mVisibilityStateComputer.getImePolicy().setImeHiddenByDisplayPolicy(true);
        } else if (!Objects.equals(deviceMethodId, selectedMethodId)) {
@@ -2164,7 +2165,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
     * <p>4. Otherwise keep the current imeId.</p>
     */
    @GuardedBy("ImfLock.class")
    private String computeCurrentDeviceMethodIdLocked(String currentMethodId) {
    private String computeCurrentDeviceMethodIdLocked(@UserIdInt int userId,
            String currentMethodId) {
        if (mVdmInternal == null) {
            mVdmInternal = LocalServices.getService(VirtualDeviceManagerInternal.class);
        }
@@ -2172,7 +2174,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            return currentMethodId;
        }

        final InputMethodSettings settings = InputMethodSettingsRepository.get(mCurrentUserId);
        final InputMethodSettings settings = InputMethodSettingsRepository.get(userId);
        final int oldDeviceId = mDeviceIdToShowIme;
        mDeviceIdToShowIme = mVdmInternal.getDeviceIdForDisplayId(mDisplayIdToShowIme);
        if (mDeviceIdToShowIme == DEVICE_ID_DEFAULT) {