diff options
author | Dianne Hackborn <hackbod@google.com> | 2015-02-12 18:37:25 -0800 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2015-02-13 10:06:52 -0800 |
commit | c5df5ddef0157a4dd23bea6fa6e79d4963dce64d (patch) | |
tree | 0e6f5a2a73add97fe07e6b5282a91a4bd4559c86 /src/com/android/settings/voice | |
parent | 3dd090d91630aa88c0545756b559f816b61f55c6 (diff) | |
download | packages_apps_Settings-c5df5ddef0157a4dd23bea6fa6e79d4963dce64d.zip packages_apps_Settings-c5df5ddef0157a4dd23bea6fa6e79d4963dce64d.tar.gz packages_apps_Settings-c5df5ddef0157a4dd23bea6fa6e79d4963dce64d.tar.bz2 |
Fix voice settings to not be broken. :(
It was setting the wrong recognizer activity, so when you
changed the voice interactor it would break the recognizer but
at least it would reset to the default interactor at boot and
not still be broken. :p
Change-Id: Icfec4f11526528b821e5fd67a6519bf5874ea133
Diffstat (limited to 'src/com/android/settings/voice')
-rw-r--r-- | src/com/android/settings/voice/VoiceInputHelper.java | 6 | ||||
-rw-r--r-- | src/com/android/settings/voice/VoiceInputSettings.java | 11 |
2 files changed, 7 insertions, 10 deletions
diff --git a/src/com/android/settings/voice/VoiceInputHelper.java b/src/com/android/settings/voice/VoiceInputHelper.java index 63b891a..916e0b4 100644 --- a/src/com/android/settings/voice/VoiceInputHelper.java +++ b/src/com/android/settings/voice/VoiceInputHelper.java @@ -136,10 +136,8 @@ public final class VoiceInputHelper { continue; } mAvailableInteractionInfos.add(new InteractionInfo(mContext.getPackageManager(), info)); - if (info.getRecognitionService() != null) { - interactorRecognizers.add(new ComponentName(resolveInfo.serviceInfo.packageName, - info.getRecognitionService())); - } + interactorRecognizers.add(new ComponentName(resolveInfo.serviceInfo.packageName, + info.getRecognitionService())); } Collections.sort(mAvailableInteractionInfos); diff --git a/src/com/android/settings/voice/VoiceInputSettings.java b/src/com/android/settings/voice/VoiceInputSettings.java index 262f145..bc299c2 100644 --- a/src/com/android/settings/voice/VoiceInputSettings.java +++ b/src/com/android/settings/voice/VoiceInputSettings.java @@ -146,12 +146,11 @@ public class VoiceInputSettings extends SettingsPreferenceFragment implements // Put the new value back into secure settings. Settings.Secure.putString(getActivity().getContentResolver(), Settings.Secure.VOICE_INTERACTION_SERVICE, key); - // Eventually we will require that an interactor always specify a recognizer - if (info.settings != null) { - Settings.Secure.putString(getActivity().getContentResolver(), - Settings.Secure.VOICE_RECOGNITION_SERVICE, - info.settings.flattenToShortString()); - } + Settings.Secure.putString(getActivity().getContentResolver(), + Settings.Secure.VOICE_RECOGNITION_SERVICE, + new ComponentName(info.service.packageName, + info.serviceInfo.getRecognitionService()) + .flattenToShortString()); return; } } |