diff --git a/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java b/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java index efc18f8659587..05e1bdd11db60 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java @@ -231,10 +231,6 @@ final class InputMethodBindingController { return mCurMethod; } - void setCurMethod(@Nullable IInputMethod curMethod) { - mCurMethod = curMethod; - } - /** * If not {@link Process#INVALID_UID}, then the UID of {@link #getCurIntent()}. */ @@ -242,10 +238,6 @@ final class InputMethodBindingController { return mCurMethodUid; } - void setCurMethodUid(int curMethodUid) { - mCurMethodUid = curMethodUid; - } - /** * Indicates whether {@link #getVisibleConnection} is currently in use. */ @@ -369,6 +361,12 @@ final class InputMethodBindingController { mService.clearClientSessionsLocked(); } + @GuardedBy("mMethodMap") + void clearCurMethodLocked() { + mCurMethod = null; + mCurMethodUid = Process.INVALID_UID; + } + @GuardedBy("mMethodMap") private void removeCurrentTokenLocked() { int curTokenDisplayId = mService.getCurTokenDisplayId(); diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index 457dc561ed85a..6bb945c5f0d90 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -606,10 +606,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub return mBindingController.getCurMethod(); } - private void setCurMethod(@Nullable IInputMethod curMethod) { - mBindingController.setCurMethod(curMethod); - } - /** * If not {@link Process#INVALID_UID}, then the UID of {@link #getCurIntent()}. */ @@ -617,10 +613,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub return mBindingController.getCurMethodUid(); } - private void setCurMethodUid(int curMethodUid) { - mBindingController.setCurMethodUid(curMethodUid); - } - /** * Time that we last initiated a bind to the input method, to determine * if we should try to disconnect and reconnect to it. @@ -2598,9 +2590,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub finishSessionLocked(mEnabledSession); mEnabledSession = null; - setCurMethod(null); - setCurMethodUid(Process.INVALID_UID); - scheduleNotifyImeUidToAudioService(getCurMethodUid()); + mBindingController.clearCurMethodLocked(); + scheduleNotifyImeUidToAudioService(Process.INVALID_UID); } hideStatusBarIconLocked(); mInFullscreenMode = false;