Set default language in new TTS clients.
A recent change altered semantics of getLanguage call to return client
language instead of service language. This solved problems
with interferences between two clients using different lanaguages.
This change created a bug - new TTS client instance have no language set.
Since reading user preferences requires additional permissions I've
added new tts service method - getClientDefaultLanguage that will return
user preferences.
I've also added new client method, getDefaultLanguage, that allow easy
access to this data.
Bug: 7666482
Change-Id: Ieb7d2ba3a99d20c513add97f054874720a1cd82e
diff --git a/core/java/android/speech/tts/TextToSpeechService.java b/core/java/android/speech/tts/TextToSpeechService.java
index 458350d..4054740 100644
--- a/core/java/android/speech/tts/TextToSpeechService.java
+++ b/core/java/android/speech/tts/TextToSpeechService.java
@@ -850,6 +850,11 @@
return onGetLanguage();
}
+ @Override
+ public String[] getClientDefaultLanguage() {
+ return getSettingsLocale();
+ }
+
/*
* If defaults are enforced, then no language is "available" except
* perhaps the default language selected by the user.