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

Reason for revert:
Caused an unexpected regression Bug 144174015

Bug: 139806621
Bug: 144103599
Fix: 144174015
Test: Manually verified Bug 144174015 disappeared as follows
 1. Open Gmail then start composing an email
 2. Swipe up the home button to recents then re-launch Gmail
 3. Do the step 2 several times.
 4. Make sure that you can still type something on Gmail.
Change-Id: I04a77afea17f9d3eb05017fa00313fad4e48cd5c
(cherry picked from commit 9494c9dbb7)
This commit is contained in:
Yohei Yukawa
2020-02-28 23:04:58 +00:00
committed by android-build-team Robot
parent b8da4a2c13
commit a08d52535d

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,10 +1225,6 @@ 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;