summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/VoiceInputOutputSettings.java
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 /src/com/android/settings/VoiceInputOutputSettings.java
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.
Diffstat (limited to 'src/com/android/settings/VoiceInputOutputSettings.java')
-rw-r--r--src/com/android/settings/VoiceInputOutputSettings.java15
1 files changed, 14 insertions, 1 deletions
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()));
}
}