summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike LeBeau <mlebeau@android.com>2010-02-12 14:47:48 -0800
committerMike LeBeau <mlebeau@android.com>2010-02-12 14:47:48 -0800
commit4c2ffc580c2c920ee172af8e2d0624492c42b159 (patch)
treedd03ff8ba16b2f5d1ff00e740014d4278c1eeda2
parent766a19b27883c478ec263eb93dc5cc820b00b7af (diff)
downloadpackages_apps_settings-4c2ffc580c2c920ee172af8e2d0624492c42b159.zip
packages_apps_settings-4c2ffc580c2c920ee172af8e2d0624492c42b159.tar.gz
packages_apps_settings-4c2ffc580c2c920ee172af8e2d0624492c42b159.tar.bz2
Make the one-recognizer case actually work. :) The settings item wasn't
actually getting linked to the recognizer's settings in that case. Also add a summary line to the line for choosing the recognizer, so you can see which one is currently selected, in the case that more than one is installed. Fix the TTS settings strings to match what we do for voice input.
-rw-r--r--res/values/strings.xml6
-rw-r--r--src/com/android/settings/VoiceInputOutputSettings.java15
2 files changed, 16 insertions, 5 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 7dd365d..2d9cbdc 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -2084,11 +2084,9 @@ found in the list of installed applications.</string>
<!-- Text-To-Speech (TTS) settings --><skip />
<!-- Title of setting on main settings screen. This item will take the user to the screen to tweak settings related to the text-to-speech functionality -->
- <string name="tts_settings">Text-to-speech</string>
- <!-- Summary of setting on main settings screen. This item will take the user to the screen to tweak settings related to the text-to-speech functionality -->
- <string name="tts_settings_summary">Set text-to-speech options</string>
+ <string name="tts_settings">Text-to-speech settings</string>
<!-- Main TTS Settings screen title -->
- <string name="tts_settings_title">Text-to-speech</string>
+ <string name="tts_settings_title">Text-to-speech settings</string>
<!-- On main TTS Settings screen, title for toggle used to force use of default TTS settings -->
<string name="use_default_tts_settings_title">Always use my settings</string>
<!-- On main TTS Settings screen, summary for toggle used to force use of default TTS settings -->
diff --git a/src/com/android/settings/VoiceInputOutputSettings.java b/src/com/android/settings/VoiceInputOutputSettings.java
index 62c909f..4011038 100644
--- a/src/com/android/settings/VoiceInputOutputSettings.java
+++ b/src/com/android/settings/VoiceInputOutputSettings.java
@@ -92,8 +92,20 @@ public class VoiceInputOutputSettings extends PreferenceActivity
removePreference(mRecognizerPref);
removePreference(mSettingsPref);
} else if (numAvailable == 1) {
- // Only one recognizer available, so don't show the list of choices.
+ // Only one recognizer available, so don't show the list of choices, but do
+ // set up the link to settings for the available recognizer.
removePreference(mRecognizerPref);
+
+ // But first set up the available recognizers map with just the one recognizer.
+ ResolveInfo resolveInfo = availableRecognitionServices.get(0);
+ String recognizerComponent =
+ new ComponentName(resolveInfo.serviceInfo.packageName,
+ resolveInfo.serviceInfo.name).flattenToString();
+ mAvailableRecognizersMap.put(recognizerComponent, resolveInfo);
+
+ String currentSetting = Settings.Secure.getString(
+ getContentResolver(), Settings.Secure.VOICE_RECOGNITION_SERVICE);
+ updateSettingsLink(currentSetting);
} else {
// Multiple recognizers available, so show the full list of choices.
populateRecognizerPreference(availableRecognitionServices);
@@ -186,6 +198,7 @@ public class VoiceInputOutputSettings extends PreferenceActivity
Intent i = new Intent(Intent.ACTION_MAIN);
i.setComponent(new ComponentName(si.packageName, settingsActivity));
mSettingsPref.setIntent(i);
+ mRecognizerPref.setSummary(currentRecognizer.loadLabel(getPackageManager()));
}
}