Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 257b2a58 authored by satok's avatar satok Committed by Android (Google) Code Review
Browse files

Merge "Hide recognition view when switchToLastInputMethod failed." into honeycomb

parents aa0458f9 760884e0
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -564,8 +564,18 @@ public class VoiceIMEConnector implements VoiceInput.UiListener {
    }

    private void switchToLastInputMethod() {
        IBinder token = mService.getWindow().getWindow().getAttributes().token;
        mImm.switchToLastInputMethod(token);
        final IBinder token = mService.getWindow().getWindow().getAttributes().token;
        new Thread ("switchToLastInputMethod") {
            @Override
            public void run() {
                if (!mImm.switchToLastInputMethod(token)) {
                    // Needs to reset here because LatinIME failed to back to any IME and
                    // the same voice subtype will be triggered in the next time.
                    mVoiceInput.reset();
                    mService.requestHideSelf(0);
                }
            }
        }.start();
    }

    private void reallyStartListening(boolean swipe) {