From c5df5ddef0157a4dd23bea6fa6e79d4963dce64d Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Thu, 12 Feb 2015 18:37:25 -0800 Subject: [PATCH] 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 --- src/com/android/settings/voice/VoiceInputHelper.java | 6 ++---- .../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 63b891af833..916e0b443e3 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 262f1458345..bc299c2bfc6 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; } }