summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/inputmethod
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2016-01-06 09:31:10 -0800
committerRoman Birg <roman@cyngn.com>2016-01-06 09:31:10 -0800
commit704d0070743f763fb9b881a86986c589caf2f72e (patch)
tree7d4b0f62bad4e8570df733665420e1fd4c938426 /src/com/android/settings/inputmethod
parentaa9a06e5215e26fa47de01edee4711aae9bbc0fc (diff)
downloadpackages_apps_Settings-704d0070743f763fb9b881a86986c589caf2f72e.zip
packages_apps_Settings-704d0070743f763fb9b881a86986c589caf2f72e.tar.gz
packages_apps_Settings-704d0070743f763fb9b881a86986c589caf2f72e.tar.bz2
Settings: remove voice wakeup link as necessary
- Package check wasn't using the package constant - Hide link for secondary users Change-Id: Id3c8269311d5cfabd146af7ce1687cdbdb35a19c Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'src/com/android/settings/inputmethod')
-rw-r--r--src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
index 0190b41..912d6a5 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
@@ -97,6 +97,7 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
private static final String KEY_TRACKPAD_SETTINGS = "gesture_pad_settings";
private static final String KEY_STYLUS_GESTURES = "stylus_gestures";
private static final String KEY_STYLUS_ICON_ENABLED = "stylus_icon_enabled";
+ private static final String KEY_VOICE_CATEGORY = "voice_category";
private static final String KEY_VOICE_WAKEUP = "voice_wakeup";
private static final String VOICE_WAKEUP_PACKAGE = "com.cyanogenmod.voicewakeup";
@@ -274,10 +275,15 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
showKeyboardLayoutDialog(identifier);
}
- if (!Utils.isPackageInstalled(getActivity(), KEY_VOICE_WAKEUP, false)) {
- Preference wakeup = findPreference(KEY_VOICE_WAKEUP);
- if (wakeup != null) {
- getPreferenceScreen().removePreference(wakeup);
+ if (!Utils.isUserOwner() ||
+ !Utils.isPackageInstalled(getActivity(), VOICE_WAKEUP_PACKAGE, false)) {
+ PreferenceCategory voiceCategory = (PreferenceCategory)
+ findPreference(KEY_VOICE_CATEGORY);
+ if (voiceCategory != null) {
+ Preference wakeup = voiceCategory.findPreference(KEY_VOICE_WAKEUP);
+ if (wakeup != null) {
+ voiceCategory.removePreference(wakeup);
+ }
}
}