summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorTarandeep Singh <tarandeep@google.com>2019-11-26 12:09:53 -0800
committerandroid-build-merger <android-build-merger@google.com>2019-11-26 12:09:53 -0800
commit80e02c8b2cd9c8a7f0ec9fc54074cc4397089e91 (patch)
tree6126e9804a156962019525e28a817f972156ffee /core/java/android
parentfb349b27834ed0ca46ba692af31f8a250fcbcb53 (diff)
parentad0a4a229a29eb8c79fe8ec3228399f2239c1c98 (diff)
DO NOT MERGE: Freeup lock when IME is set inactive and unbound
am: ad0a4a229a Change-Id: Id4551d19bc2c05476c311a888a08aa8f5d449d20
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/inputmethod/InputMethodManager.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index d75810ad0e37..d3618adca6c4 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -655,14 +655,14 @@ public final class InputMethodManager {
} catch (RemoteException e) {
}
}
- // Check focus again in case that "onWindowFocus" is called before
- // handling this message.
- if (mServedView != null && canStartInput(mServedView)) {
- if (checkFocusNoStartInput(mRestartOnNextWindowFocus)) {
- final int reason = active ? StartInputReason.ACTIVATED_BY_IMMS
- : StartInputReason.DEACTIVATED_BY_IMMS;
- startInputInner(reason, null, 0, 0, 0);
- }
+ }
+ // Check focus again in case that "onWindowFocus" is called before
+ // handling this message.
+ if (mServedView != null && canStartInput(mServedView)) {
+ if (checkFocusNoStartInput(mRestartOnNextWindowFocus)) {
+ final int reason = active ? StartInputReason.ACTIVATED_BY_IMMS
+ : StartInputReason.DEACTIVATED_BY_IMMS;
+ startInputInner(reason, null, 0, 0, 0);
}
}
return;
@@ -1225,6 +1225,10 @@ public final class InputMethodManager {
*/
void clearBindingLocked() {
if (DEBUG) Log.v(TAG, "Clearing binding!");
+ if (mWindowFocusGainFuture != null) {
+ mWindowFocusGainFuture.cancel(false /* mayInterruptIfRunning */);
+ mWindowFocusGainFuture = null;
+ }
clearConnectionLocked();
setInputChannelLocked(null);
mBindSequence = -1;