Loading java/src/com/android/inputmethod/latin/InputAttributes.java +9 −1 Original line number Original line Diff line number Diff line Loading @@ -41,6 +41,7 @@ public final class InputAttributes { final public boolean mShouldShowSuggestions; final public boolean mShouldShowSuggestions; final public boolean mApplicationSpecifiedCompletionOn; final public boolean mApplicationSpecifiedCompletionOn; final public boolean mShouldInsertSpacesAutomatically; final public boolean mShouldInsertSpacesAutomatically; final public boolean mShouldShowVoiceInputKey; final private int mInputType; final private int mInputType; final private EditorInfo mEditorInfo; final private EditorInfo mEditorInfo; final private String mPackageNameForPrivateImeOptions; final private String mPackageNameForPrivateImeOptions; Loading Loading @@ -74,6 +75,7 @@ public final class InputAttributes { mInputTypeNoAutoCorrect = false; mInputTypeNoAutoCorrect = false; mApplicationSpecifiedCompletionOn = false; mApplicationSpecifiedCompletionOn = false; mShouldInsertSpacesAutomatically = false; mShouldInsertSpacesAutomatically = false; mShouldShowVoiceInputKey = false; return; return; } } // inputClass == InputType.TYPE_CLASS_TEXT // inputClass == InputType.TYPE_CLASS_TEXT Loading @@ -99,6 +101,12 @@ public final class InputAttributes { mShouldInsertSpacesAutomatically = InputTypeUtils.isAutoSpaceFriendlyType(inputType); mShouldInsertSpacesAutomatically = InputTypeUtils.isAutoSpaceFriendlyType(inputType); final boolean noMicrophone = mIsPasswordField || InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS == variation || InputType.TYPE_TEXT_VARIATION_URI == variation || hasNoMicrophoneKeyOption(); mShouldShowVoiceInputKey = !noMicrophone; // If it's a browser edit field and auto correct is not ON explicitly, then // If it's a browser edit field and auto correct is not ON explicitly, then // disable auto correction, but keep suggestions on. // disable auto correction, but keep suggestions on. // If NO_SUGGESTIONS is set, don't do prediction. // If NO_SUGGESTIONS is set, don't do prediction. Loading @@ -119,7 +127,7 @@ public final class InputAttributes { return editorInfo.inputType == mInputType; return editorInfo.inputType == mInputType; } } public boolean hasNoMicrophoneKeyOption() { private boolean hasNoMicrophoneKeyOption() { @SuppressWarnings("deprecation") @SuppressWarnings("deprecation") final boolean deprecatedNoMicrophone = InputAttributes.inPrivateImeOptions( final boolean deprecatedNoMicrophone = InputAttributes.inPrivateImeOptions( null, NO_MICROPHONE_COMPAT, mEditorInfo); null, NO_MICROPHONE_COMPAT, mEditorInfo); Loading java/src/com/android/inputmethod/latin/settings/SettingsValues.java +1 −2 Original line number Original line Diff line number Diff line Loading @@ -125,8 +125,7 @@ public final class SettingsValues { mSlidingKeyInputPreviewEnabled = prefs.getBoolean( mSlidingKeyInputPreviewEnabled = prefs.getBoolean( DebugSettings.PREF_SLIDING_KEY_INPUT_PREVIEW, true); DebugSettings.PREF_SLIDING_KEY_INPUT_PREVIEW, true); mShowsVoiceInputKey = needsToShowVoiceInputKey(prefs, res) mShowsVoiceInputKey = needsToShowVoiceInputKey(prefs, res) && !mInputAttributes.mIsPasswordField && mInputAttributes.mShouldShowVoiceInputKey && !mInputAttributes.hasNoMicrophoneKeyOption() && SubtypeSwitcher.getInstance().isShortcutImeEnabled(); && SubtypeSwitcher.getInstance().isShortcutImeEnabled(); final String autoCorrectionThresholdRawValue = prefs.getString( final String autoCorrectionThresholdRawValue = prefs.getString( Settings.PREF_AUTO_CORRECTION_THRESHOLD, Settings.PREF_AUTO_CORRECTION_THRESHOLD, Loading Loading
java/src/com/android/inputmethod/latin/InputAttributes.java +9 −1 Original line number Original line Diff line number Diff line Loading @@ -41,6 +41,7 @@ public final class InputAttributes { final public boolean mShouldShowSuggestions; final public boolean mShouldShowSuggestions; final public boolean mApplicationSpecifiedCompletionOn; final public boolean mApplicationSpecifiedCompletionOn; final public boolean mShouldInsertSpacesAutomatically; final public boolean mShouldInsertSpacesAutomatically; final public boolean mShouldShowVoiceInputKey; final private int mInputType; final private int mInputType; final private EditorInfo mEditorInfo; final private EditorInfo mEditorInfo; final private String mPackageNameForPrivateImeOptions; final private String mPackageNameForPrivateImeOptions; Loading Loading @@ -74,6 +75,7 @@ public final class InputAttributes { mInputTypeNoAutoCorrect = false; mInputTypeNoAutoCorrect = false; mApplicationSpecifiedCompletionOn = false; mApplicationSpecifiedCompletionOn = false; mShouldInsertSpacesAutomatically = false; mShouldInsertSpacesAutomatically = false; mShouldShowVoiceInputKey = false; return; return; } } // inputClass == InputType.TYPE_CLASS_TEXT // inputClass == InputType.TYPE_CLASS_TEXT Loading @@ -99,6 +101,12 @@ public final class InputAttributes { mShouldInsertSpacesAutomatically = InputTypeUtils.isAutoSpaceFriendlyType(inputType); mShouldInsertSpacesAutomatically = InputTypeUtils.isAutoSpaceFriendlyType(inputType); final boolean noMicrophone = mIsPasswordField || InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS == variation || InputType.TYPE_TEXT_VARIATION_URI == variation || hasNoMicrophoneKeyOption(); mShouldShowVoiceInputKey = !noMicrophone; // If it's a browser edit field and auto correct is not ON explicitly, then // If it's a browser edit field and auto correct is not ON explicitly, then // disable auto correction, but keep suggestions on. // disable auto correction, but keep suggestions on. // If NO_SUGGESTIONS is set, don't do prediction. // If NO_SUGGESTIONS is set, don't do prediction. Loading @@ -119,7 +127,7 @@ public final class InputAttributes { return editorInfo.inputType == mInputType; return editorInfo.inputType == mInputType; } } public boolean hasNoMicrophoneKeyOption() { private boolean hasNoMicrophoneKeyOption() { @SuppressWarnings("deprecation") @SuppressWarnings("deprecation") final boolean deprecatedNoMicrophone = InputAttributes.inPrivateImeOptions( final boolean deprecatedNoMicrophone = InputAttributes.inPrivateImeOptions( null, NO_MICROPHONE_COMPAT, mEditorInfo); null, NO_MICROPHONE_COMPAT, mEditorInfo); Loading
java/src/com/android/inputmethod/latin/settings/SettingsValues.java +1 −2 Original line number Original line Diff line number Diff line Loading @@ -125,8 +125,7 @@ public final class SettingsValues { mSlidingKeyInputPreviewEnabled = prefs.getBoolean( mSlidingKeyInputPreviewEnabled = prefs.getBoolean( DebugSettings.PREF_SLIDING_KEY_INPUT_PREVIEW, true); DebugSettings.PREF_SLIDING_KEY_INPUT_PREVIEW, true); mShowsVoiceInputKey = needsToShowVoiceInputKey(prefs, res) mShowsVoiceInputKey = needsToShowVoiceInputKey(prefs, res) && !mInputAttributes.mIsPasswordField && mInputAttributes.mShouldShowVoiceInputKey && !mInputAttributes.hasNoMicrophoneKeyOption() && SubtypeSwitcher.getInstance().isShortcutImeEnabled(); && SubtypeSwitcher.getInstance().isShortcutImeEnabled(); final String autoCorrectionThresholdRawValue = prefs.getString( final String autoCorrectionThresholdRawValue = prefs.getString( Settings.PREF_AUTO_CORRECTION_THRESHOLD, Settings.PREF_AUTO_CORRECTION_THRESHOLD, Loading