summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2021-08-04 11:57:42 -0700
committerYohei Yukawa <yukawa@google.com>2021-08-04 11:57:42 -0700
commitd1ff9740c14fe144a2c67e953d0e4f9a7f8c6e46 (patch)
treeb7197e7e68892295eb4b05c0e3ec660eae13e971 /core/java/android
parentb37f32cfeceb76dd8ae9976575191a5620877dab (diff)
Lock down RemoteInputConnectionImpl#getInputConnection()
This is a mechanical refactoring CL that locks down RemoteInputConnectionImpl#getInputConnection() as a private method. This is supposed to be helpful to to avoid future misuse of raw InputConnection instance outside RemoteInputConnectionImpl. Note that InputMethodManager#isAcceptingText() remains to have the same observable behavior in this CL. The key fact is that the following two fields are updated in an atomic way. * RemoteInputConnectionImpl#mInputConnection * RemoteInputConnectionImpl#mFinished Bug: 192412909 Test: presubmit Change-Id: Ic5fbc6213ad62df95fc0b7eef18bab1fd9fbdbf1
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/inputmethod/InputMethodManager.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index 5f659a6afba9..ab7e5a92284f 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -1381,8 +1381,7 @@ public final class InputMethodManager {
public boolean isAcceptingText() {
checkFocus();
synchronized (mH) {
- return mServedInputConnection != null
- && mServedInputConnection.getInputConnection() != null;
+ return mServedInputConnection != null && !mServedInputConnection.isFinished();
}
}