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
This commit is contained in:
Dianne Hackborn
2015-02-12 18:37:25 -08:00
parent 3dd090d916
commit c5df5ddef0
2 changed files with 7 additions and 10 deletions

View File

@@ -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);

View File

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