Merge "DO NOT MERGE: Freeup lock when IME is set inactive and unbound" into qt-qpr1-dev

This commit is contained in:
TreeHugger Robot
2019-11-26 19:42:45 +00:00
committed by Android (Google) Code Review

View File

@@ -655,14 +655,14 @@ public final class InputMethodManager {
} catch (RemoteException e) { } catch (RemoteException e) {
} }
} }
// Check focus again in case that "onWindowFocus" is called before }
// handling this message. // Check focus again in case that "onWindowFocus" is called before
if (mServedView != null && canStartInput(mServedView)) { // handling this message.
if (checkFocusNoStartInput(mRestartOnNextWindowFocus)) { if (mServedView != null && canStartInput(mServedView)) {
final int reason = active ? StartInputReason.ACTIVATED_BY_IMMS if (checkFocusNoStartInput(mRestartOnNextWindowFocus)) {
: StartInputReason.DEACTIVATED_BY_IMMS; final int reason = active ? StartInputReason.ACTIVATED_BY_IMMS
startInputInner(reason, null, 0, 0, 0); : StartInputReason.DEACTIVATED_BY_IMMS;
} startInputInner(reason, null, 0, 0, 0);
} }
} }
return; return;
@@ -1225,6 +1225,10 @@ public final class InputMethodManager {
*/ */
void clearBindingLocked() { void clearBindingLocked() {
if (DEBUG) Log.v(TAG, "Clearing binding!"); if (DEBUG) Log.v(TAG, "Clearing binding!");
if (mWindowFocusGainFuture != null) {
mWindowFocusGainFuture.cancel(false /* mayInterruptIfRunning */);
mWindowFocusGainFuture = null;
}
clearConnectionLocked(); clearConnectionLocked();
setInputChannelLocked(null); setInputChannelLocked(null);
mBindSequence = -1; mBindSequence = -1;