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) { } 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;