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

Commit 535698c5 authored by Luca Zanolin's avatar Luca Zanolin
Browse files

Remove the mic from the keyboard in SearchView

Bug: 5357750
Change-Id: I20c87a25e95222772c6b5154d09dd681b966fd9a
parent ca35bc5a
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -92,6 +92,11 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
    private static final boolean DBG = false;
    private static final String LOG_TAG = "SearchView";

    /**
     * Private constant for removing the microphone in the keyboard.
     */
    private static final String IME_OPTION_NO_MICROPHONE = "nm";

    private OnQueryTextListener mOnQueryChangeListener;
    private OnCloseListener mOnCloseListener;
    private OnFocusChangeListener mOnQueryTextFocusChangeListener;
@@ -335,6 +340,12 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
        }
        // Cache the voice search capability
        mVoiceButtonEnabled = hasVoiceSearch();

        if (mVoiceButtonEnabled) {
            // Disable the microphone on the keyboard, as a mic is displayed near the text box
            // TODO: use imeOptions to disable voice input when the new API will be available
            mQueryTextView.setPrivateImeOptions(IME_OPTION_NO_MICROPHONE);
        }
        updateViewsVisibility(isIconified());
    }