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; } }