diff options
| author | 2024-06-12 18:20:05 -0700 | |
|---|---|---|
| committer | 2024-06-12 18:20:05 -0700 | |
| commit | 43e460464a196e36181019112c53379b95ea9dca (patch) | |
| tree | 39e692da10ac8534aecf1dfebff977a929b43aaa | |
| parent | 25baebe5a9d3a8e14d1b46ba6db6f4908d452c7e (diff) | |
Inline several methods in IMMS#attachNewInputLocked()
This is a mechanical refactoring CL. There must be no behavior change.
Bug: 341558132
Test: presubmit
Flag: EXEMPT refactor
Change-Id: Ifc450289fba3fbcc4944b7ba956a5dfaaa872008
| -rw-r--r-- | services/core/java/com/android/server/inputmethod/InputMethodManagerService.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index 6b15bcee7b5b..f5bec85fc935 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -1998,17 +1998,18 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. @GuardedBy("ImfLock.class") @NonNull InputBindResult attachNewInputLocked(@StartInputReason int startInputReason, boolean initial) { + final int userId = mCurrentUserId; + final var bindingController = getInputMethodBindingController(userId); if (!mBoundToMethod) { - getCurMethodLocked().bindInput(mCurClient.mBinding); + bindingController.getCurMethod().bindInput(mCurClient.mBinding); mBoundToMethod = true; } final boolean restarting = !initial; final Binder startInputToken = new Binder(); - final var bindingController = getInputMethodBindingController(mCurrentUserId); final StartInputInfo info = new StartInputInfo(mCurrentUserId, - getCurTokenLocked(), - getCurTokenDisplayIdLocked(), bindingController.getCurId(), startInputReason, + bindingController.getCurToken(), bindingController.getCurTokenDisplayId(), + bindingController.getCurId(), startInputReason, restarting, UserHandle.getUserId(mCurClient.mUid), mCurClient.mSelfReportedDisplayId, mImeBindingState.mFocusedWindow, mCurEditorInfo, mImeBindingState.mFocusedWindowSoftInputMode, @@ -2021,9 +2022,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. // same-user scenarios. // That said ignoring cross-user scenario will never affect IMEs that do not have // INTERACT_ACROSS_USERS(_FULL) permissions, which is actually almost always the case. - if (mCurrentUserId == UserHandle.getUserId( - mCurClient.mUid)) { - mPackageManagerInternal.grantImplicitAccess(mCurrentUserId, null /* intent */, + if (userId == UserHandle.getUserId(mCurClient.mUid)) { + mPackageManagerInternal.grantImplicitAccess(userId, null /* intent */, UserHandle.getAppId(bindingController.getCurMethodUid()), mCurClient.mUid, true /* direct */); } @@ -2053,7 +2053,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. } final var curId = bindingController.getCurId(); - final InputMethodInfo curInputMethodInfo = InputMethodSettingsRepository.get(mCurrentUserId) + final InputMethodInfo curInputMethodInfo = InputMethodSettingsRepository.get(userId) .getMethodMap().get(curId); final boolean suppressesSpellChecker = curInputMethodInfo != null && curInputMethodInfo.suppressesSpellChecker(); |