Remove some unnecessary setLanguage() calls.
This prevents QUEUE_FLUSH from working as intented since there is a (blocking) setLanguage() call that waits for the previous synthesis to complete before flushing the queue. bug:5288327 Change-Id: I00467f0ac1584863ae27bfc076b8413e29e5379b
This commit is contained in:
@@ -198,9 +198,13 @@ public class TextToSpeechSettings extends SettingsPreferenceFragment implements
|
|||||||
currentEngine);
|
currentEngine);
|
||||||
if (localeString != null) {
|
if (localeString != null) {
|
||||||
final String[] locale = TtsEngines.parseLocalePref(localeString);
|
final String[] locale = TtsEngines.parseLocalePref(localeString);
|
||||||
|
final Locale newLocale = new Locale(locale[0], locale[1], locale[2]);
|
||||||
|
final Locale engineLocale = mTts.getLanguage();
|
||||||
|
|
||||||
|
if (!newLocale.equals(engineLocale)) {
|
||||||
if (DBG) Log.d(TAG, "Loading language ahead of sample check : " + locale);
|
if (DBG) Log.d(TAG, "Loading language ahead of sample check : " + locale);
|
||||||
mTts.setLanguage(new Locale(locale[0], locale[1], locale[2]));
|
mTts.setLanguage(newLocale);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user