From 0b916be981f926661c9e24d5ab8ded29bc9be7e2 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Mon, 29 May 2017 20:25:28 -0400
Subject: [PATCH] Remove voice input key

Change-Id: Ifb56c679d3a9b6c035fcdd4596ec0b3b5653bea8
---
 java/res/values-sw430dp/config-per-form-factor.xml                  | 2 +-
 java/res/values/config-per-form-factor.xml                          | 2 +-
 java/res/xml/prefs_screen_preferences.xml                           | 2 +-
 .../inputmethod/latin/settings/PreferencesSettingsFragment.java     | 3 +--
 java/src/com/android/inputmethod/latin/settings/SettingsValues.java | 6 ++----
 5 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/java/res/values-sw430dp/config-per-form-factor.xml b/java/res/values-sw430dp/config-per-form-factor.xml
index 8868081c3..2199ab6b2 100644
--- a/java/res/values-sw430dp/config-per-form-factor.xml
+++ b/java/res/values-sw430dp/config-per-form-factor.xml
@@ -24,7 +24,7 @@
     <!-- Whether or not Popup on key press is enabled by default -->
     <bool name="config_default_key_preview_popup">true</bool>
     <bool name="config_default_sound_enabled">false</bool>
-    <bool name="config_enable_show_voice_key_option">true</bool>
+    <bool name="config_enable_show_voice_key_option">false</bool>
     <bool name="config_key_selection_by_dragging_finger">true</bool>
     <!-- Showing more keys keyboard, just above the touched point if true, aligned to the key if
          false -->
diff --git a/java/res/values/config-per-form-factor.xml b/java/res/values/config-per-form-factor.xml
index 67fc75134..1bbf1640e 100644
--- a/java/res/values/config-per-form-factor.xml
+++ b/java/res/values/config-per-form-factor.xml
@@ -24,7 +24,7 @@
     <!-- Whether or not Popup on key press is enabled by default -->
     <bool name="config_default_key_preview_popup">true</bool>
     <bool name="config_default_sound_enabled">false</bool>
-    <bool name="config_enable_show_voice_key_option">true</bool>
+    <bool name="config_enable_show_voice_key_option">false</bool>
     <bool name="config_key_selection_by_dragging_finger">true</bool>
     <!-- Showing more keys keyboard, just above the touched point if true, aligned to the key if
          false -->
diff --git a/java/res/xml/prefs_screen_preferences.xml b/java/res/xml/prefs_screen_preferences.xml
index 101edc855..540f9f6a6 100644
--- a/java/res/xml/prefs_screen_preferences.xml
+++ b/java/res/xml/prefs_screen_preferences.xml
@@ -48,6 +48,6 @@
     <CheckBoxPreference
         android:key="pref_voice_input_key"
         android:title="@string/voice_input"
-        android:defaultValue="true"
+        android:defaultValue="false"
         android:persistent="true" />
 </PreferenceScreen>
diff --git a/java/src/com/android/inputmethod/latin/settings/PreferencesSettingsFragment.java b/java/src/com/android/inputmethod/latin/settings/PreferencesSettingsFragment.java
index d9858e61f..cd513a47e 100644
--- a/java/src/com/android/inputmethod/latin/settings/PreferencesSettingsFragment.java
+++ b/java/src/com/android/inputmethod/latin/settings/PreferencesSettingsFragment.java
@@ -56,8 +56,7 @@ public final class PreferencesSettingsFragment extends SubScreenFragment {
         // initialization method of these classes here. See {@link LatinIME#onCreate()}.
         RichInputMethodManager.init(context);
 
-        final boolean showVoiceKeyOption = res.getBoolean(
-                R.bool.config_enable_show_voice_key_option);
+        final boolean showVoiceKeyOption = false;
         if (!showVoiceKeyOption) {
             removePreference(Settings.PREF_VOICE_INPUT_KEY);
         }
diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
index 918978949..4c8618234 100644
--- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
+++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
@@ -137,9 +137,7 @@ public class SettingsValues {
         mKeyPreviewPopupOn = Settings.readKeyPreviewPopupEnabled(prefs, res);
         mSlidingKeyInputPreviewEnabled = prefs.getBoolean(
                 DebugSettings.PREF_SLIDING_KEY_INPUT_PREVIEW, true);
-        mShowsVoiceInputKey = needsToShowVoiceInputKey(prefs, res)
-                && mInputAttributes.mShouldShowVoiceInputKey
-                && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;
+        mShowsVoiceInputKey = false;
         mIncludesOtherImesInLanguageSwitchList = Settings.ENABLE_SHOW_LANGUAGE_SWITCH_KEY_SETTINGS
                 ? prefs.getBoolean(Settings.PREF_INCLUDE_OTHER_IMES_IN_LANGUAGE_SWITCH_LIST, false)
                 : true /* forcibly */;
@@ -368,7 +366,7 @@ public class SettingsValues {
                     .remove(Settings.PREF_VOICE_MODE_OBSOLETE)
                     .apply();
         }
-        return prefs.getBoolean(Settings.PREF_VOICE_INPUT_KEY, true);
+        return prefs.getBoolean(Settings.PREF_VOICE_INPUT_KEY, false);
     }
 
     public String dump() {
-- 
2.13.0

