DO NOT MERGE: Freeup lock when IME is set inactive and unbound

am: ad0a4a229a

Change-Id: Id4551d19bc2c05476c311a888a08aa8f5d449d20
This commit is contained in:
Tarandeep Singh
2019-11-26 12:09:53 -08:00
committed by android-build-merger

View File

@@ -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;