From 73e716f20284f929b2c0323c9e4759efe558de9d Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Sun, 31 Jul 2011 18:20:20 -0700 Subject: [PATCH] Be aware of "nm" and "noMicrophoneKey" private IME option Bug: 4340933 Change-Id: I787108a73d4450963d644bc7070ae1672ebb4455 --- .../com/android/inputmethod/keyboard/KeyboardSwitcher.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index ee9eb7b00..28c91b848 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -313,7 +313,12 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha } final boolean settingsKeyEnabled = settingsValues.isSettingsKeyEnabled(editorInfo); - final boolean voiceKeyEnabled = settingsValues.isVoiceKeyEnabled(editorInfo); + final boolean noMicrophone = Utils.inPrivateImeOptions( + mPackageName, LatinIME.IME_OPTION_NO_MICROPHONE, editorInfo) + || Utils.inPrivateImeOptions( + null, LatinIME.IME_OPTION_NO_MICROPHONE_COMPAT, editorInfo); + final boolean voiceKeyEnabled = settingsValues.isVoiceKeyEnabled(editorInfo) + && !noMicrophone; final boolean voiceKeyOnMain = settingsValues.isVoiceKeyOnMain(); final boolean noSettingsKey = Utils.inPrivateImeOptions( mPackageName, LatinIME.IME_OPTION_NO_SETTINGS_KEY, editorInfo);