From 3786bc549891592335be0f454609d9c626d69ef4 Mon Sep 17 00:00:00 2001 From: Przemyslaw Szczepaniak Date: Thu, 11 Sep 2014 16:10:32 +0100 Subject: [PATCH] Replace TreeSet with HashSet. Both Locale and Voice do not implement Comparable. Bug: 17467923 Change-Id: I683577e5b18ae1892e1ccea5ea241e1d016c9517 --- core/java/android/speech/tts/TextToSpeech.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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"); }