diff options
| author | 2022-10-06 08:52:37 -0700 | |
|---|---|---|
| committer | 2022-10-06 08:52:37 -0700 | |
| commit | be0ad5c9b68ddec1634d51d9fe35b4cc7f63c8f9 (patch) | |
| tree | c065524a3719f2082ef2447f6265a1a8f6eb58ac | |
| parent | fdba7f40918ac5bd04382ad664e368e929a95a0a (diff) | |
Clean up InputMethodBindingController a bit
This CL does several minor clean-ups for InputMethodBindingController.
- Removed an unused field mRes.
- Added a missing @GuardedBy("ImfLock.class") annotation.
- Inlined bindCurrentInputMethodServiceVisibleConnection().
There must be no observable behavior change.
Bug: 234882948
Test: presubmit
Change-Id: Idc7371dd15f53c39ea508633bce9a30e56c773cb
| -rw-r--r-- | services/core/java/com/android/server/inputmethod/InputMethodBindingController.java | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java b/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java index 5a21d7bfe7a4..6dbb362db030 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java @@ -26,7 +26,6 @@ import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.content.pm.PackageManagerInternal; -import android.content.res.Resources; import android.inputmethodservice.InputMethodService; import android.os.Binder; import android.os.IBinder; @@ -65,7 +64,6 @@ final class InputMethodBindingController { @NonNull private final InputMethodUtils.InputMethodSettings mSettings; @NonNull private final PackageManagerInternal mPackageManagerInternal; @NonNull private final WindowManagerInternal mWindowManagerInternal; - @NonNull private final Resources mRes; @GuardedBy("ImfLock.class") private long mLastBindTime; @GuardedBy("ImfLock.class") private boolean mHasConnection; @@ -77,7 +75,7 @@ final class InputMethodBindingController { @GuardedBy("ImfLock.class") @Nullable private IBinder mCurToken; @GuardedBy("ImfLock.class") private int mCurSeq; @GuardedBy("ImfLock.class") private boolean mVisibleBound; - private boolean mSupportsStylusHw; + @GuardedBy("ImfLock.class") private boolean mSupportsStylusHw; /** * Binding flags for establishing connection to the {@link InputMethodService}. @@ -105,7 +103,6 @@ final class InputMethodBindingController { mSettings = mService.mSettings; mPackageManagerInternal = mService.mPackageManagerInternal; mWindowManagerInternal = mService.mWindowManagerInternal; - mRes = mService.mRes; } /** @@ -460,13 +457,6 @@ final class InputMethodBindingController { } @GuardedBy("ImfLock.class") - private boolean bindCurrentInputMethodServiceVisibleConnection() { - mVisibleBound = bindCurrentInputMethodService(mVisibleConnection, - IME_VISIBLE_BIND_FLAGS); - return mVisibleBound; - } - - @GuardedBy("ImfLock.class") private boolean bindCurrentInputMethodServiceMainConnection() { mHasConnection = bindCurrentInputMethodService(mMainConnection, IME_CONNECTION_BIND_FLAGS); return mHasConnection; @@ -483,7 +473,8 @@ final class InputMethodBindingController { if (mCurMethod != null) { if (DEBUG) Slog.d(TAG, "setCurrentMethodVisible: mCurToken=" + mCurToken); if (mHasConnection && !mVisibleBound) { - bindCurrentInputMethodServiceVisibleConnection(); + mVisibleBound = bindCurrentInputMethodService(mVisibleConnection, + IME_VISIBLE_BIND_FLAGS); } return; } |