LatinIME: Remove voice input key

This commit is contained in:
Tad 2017-05-29 20:27:06 -04:00
parent f5af24bbcb
commit dc4f821e44
2 changed files with 96 additions and 0 deletions

View File

@ -0,0 +1,93 @@
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

View File

@ -121,6 +121,9 @@ sed -i 's/Settings.Secure.WEB_ACTION_ENABLED, 1/Settings.Secure.WEB_ACTION_ENABL
sed -i 's/private int mPasswordMaxLength = 16;/private int mPasswordMaxLength = 48;/' src/com/android/settings/ChooseLockPassword.java; #Increase max password length sed -i 's/private int mPasswordMaxLength = 16;/private int mPasswordMaxLength = 48;/' src/com/android/settings/ChooseLockPassword.java; #Increase max password length
sed -i 's/GSETTINGS_PROVIDER = "com.google.settings";/GSETTINGS_PROVIDER = "com.google.oQuae4av";/' src/com/android/settings/PrivacySettings.java; #MicroG doesn't support Backup, hide the options sed -i 's/GSETTINGS_PROVIDER = "com.google.settings";/GSETTINGS_PROVIDER = "com.google.oQuae4av";/' src/com/android/settings/PrivacySettings.java; #MicroG doesn't support Backup, hide the options
enter "packages/inputmethods/LatinIME"
patch -p1 < $patches"android_packages_inputmethods_LatinIME/0001-Voice.patch" #Remove voice input key
enter "system/core" enter "system/core"
cat /tmp/ar/hosts >> rootdir/etc/hosts #Merge in our HOSTS file cat /tmp/ar/hosts >> rootdir/etc/hosts #Merge in our HOSTS file
patch -p1 < $patches"android_system_core/0001-Hardening.patch" #Misc hardening patch -p1 < $patches"android_system_core/0001-Hardening.patch" #Misc hardening