Loading services/core/java/com/android/server/inputmethod/InputMethodBindingController.java +12 −0 Original line number Diff line number Diff line Loading @@ -194,6 +194,18 @@ final class InputMethodBindingController { mSelectedMethodId = selectedMethodId; } /** * Returns {@link InputMethodInfo} that is queried from {@link #getSelectedMethodId()}. * * @return {@link InputMethodInfo} whose IME ID is the same as {@link #getSelectedMethodId()}. * {@code null} otherwise */ @GuardedBy("ImfLock.class") @Nullable InputMethodInfo getSelectedMethod() { return InputMethodSettingsRepository.get(mUserId).getMethodMap().get(mSelectedMethodId); } /** * The token we have made for the currently active input method, to * identify it in the future. Loading services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +7 −8 Original line number Diff line number Diff line Loading @@ -4192,10 +4192,10 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. @GuardedBy("ImfLock.class") private boolean switchToNextInputMethodLocked(@Nullable IBinder token, boolean onlyCurrentIme) { final InputMethodSettings settings = InputMethodSettingsRepository.get(mCurrentUserId); final int userId = mCurrentUserId; final var currentImi = getInputMethodBindingController(userId).getSelectedMethod(); final ImeSubtypeListItem nextSubtype = mSwitchingController.getNextInputMethodLocked( onlyCurrentIme, settings.getMethodMap().get(getSelectedMethodIdLocked()), mCurrentSubtype); onlyCurrentIme, currentImi, mCurrentSubtype); if (nextSubtype == null) { return false; } Loading @@ -4210,10 +4210,10 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. if (!calledWithValidTokenLocked(token)) { return false; } final InputMethodSettings settings = InputMethodSettingsRepository.get(mCurrentUserId); final int userId = mCurrentUserId; final var currentImi = getInputMethodBindingController(userId).getSelectedMethod(); final ImeSubtypeListItem nextSubtype = mSwitchingController.getNextInputMethodLocked( false /* onlyCurrentIme */, settings.getMethodMap().get(getSelectedMethodIdLocked()), mCurrentSubtype); false /* onlyCurrentIme */, currentImi, mCurrentSubtype); return nextSubtype != null; } } Loading Loading @@ -4648,8 +4648,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. if (mCurrentUserId != mSwitchingController.getUserId()) { return; } final InputMethodInfo imi = InputMethodSettingsRepository.get(mCurrentUserId) .getMethodMap().get(getSelectedMethodIdLocked()); final var imi = getInputMethodBindingController(mCurrentUserId).getSelectedMethod(); if (imi != null) { mSwitchingController.onUserActionLocked(imi, mCurrentSubtype); } Loading Loading
services/core/java/com/android/server/inputmethod/InputMethodBindingController.java +12 −0 Original line number Diff line number Diff line Loading @@ -194,6 +194,18 @@ final class InputMethodBindingController { mSelectedMethodId = selectedMethodId; } /** * Returns {@link InputMethodInfo} that is queried from {@link #getSelectedMethodId()}. * * @return {@link InputMethodInfo} whose IME ID is the same as {@link #getSelectedMethodId()}. * {@code null} otherwise */ @GuardedBy("ImfLock.class") @Nullable InputMethodInfo getSelectedMethod() { return InputMethodSettingsRepository.get(mUserId).getMethodMap().get(mSelectedMethodId); } /** * The token we have made for the currently active input method, to * identify it in the future. Loading
services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +7 −8 Original line number Diff line number Diff line Loading @@ -4192,10 +4192,10 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. @GuardedBy("ImfLock.class") private boolean switchToNextInputMethodLocked(@Nullable IBinder token, boolean onlyCurrentIme) { final InputMethodSettings settings = InputMethodSettingsRepository.get(mCurrentUserId); final int userId = mCurrentUserId; final var currentImi = getInputMethodBindingController(userId).getSelectedMethod(); final ImeSubtypeListItem nextSubtype = mSwitchingController.getNextInputMethodLocked( onlyCurrentIme, settings.getMethodMap().get(getSelectedMethodIdLocked()), mCurrentSubtype); onlyCurrentIme, currentImi, mCurrentSubtype); if (nextSubtype == null) { return false; } Loading @@ -4210,10 +4210,10 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. if (!calledWithValidTokenLocked(token)) { return false; } final InputMethodSettings settings = InputMethodSettingsRepository.get(mCurrentUserId); final int userId = mCurrentUserId; final var currentImi = getInputMethodBindingController(userId).getSelectedMethod(); final ImeSubtypeListItem nextSubtype = mSwitchingController.getNextInputMethodLocked( false /* onlyCurrentIme */, settings.getMethodMap().get(getSelectedMethodIdLocked()), mCurrentSubtype); false /* onlyCurrentIme */, currentImi, mCurrentSubtype); return nextSubtype != null; } } Loading Loading @@ -4648,8 +4648,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. if (mCurrentUserId != mSwitchingController.getUserId()) { return; } final InputMethodInfo imi = InputMethodSettingsRepository.get(mCurrentUserId) .getMethodMap().get(getSelectedMethodIdLocked()); final var imi = getInputMethodBindingController(mCurrentUserId).getSelectedMethod(); if (imi != null) { mSwitchingController.onUserActionLocked(imi, mCurrentSubtype); } Loading