diff --git a/core/java/android/speech/tts/TextToSpeech.java b/core/java/android/speech/tts/TextToSpeech.java index a4b6e925aef96..9be220e896184 100644 --- a/core/java/android/speech/tts/TextToSpeech.java +++ b/core/java/android/speech/tts/TextToSpeech.java @@ -46,7 +46,6 @@ import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Set; -import java.util.TreeSet; /** * @@ -1567,10 +1566,10 @@ public class TextToSpeech { @Override public Set run(ITextToSpeechService service) throws RemoteException { List voices = service.getVoices(); - if (voices != null) { - return new TreeSet(); + if (voices == null) { + return new HashSet(); } - TreeSet locales = new TreeSet(); + HashSet locales = new HashSet(); for (Voice voice : voices) { locales.add(voice.getLocale()); } @@ -1593,7 +1592,7 @@ public class TextToSpeech { @Override public Set run(ITextToSpeechService service) throws RemoteException { List voices = service.getVoices(); - return (voices != null) ? new TreeSet(voices) : new TreeSet(); + return (voices != null) ? new HashSet(voices) : new HashSet(); } }, null, "getVoices"); }