summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-08-11 15:18:29 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-08-11 15:18:29 -0700
commiteccd6fdd0d86b8610b738fc15c707eedc00ec9dc (patch)
tree2fa4ac2c762638cd7df61a1900b77623dea14e39 /core/java
parent3b5f4a841e9e87442eeacd7773bd2a6ca8710019 (diff)
parent69e67a3e2e863fa8828151ef3a488bfcaa504f7a (diff)
downloadframeworks_base-eccd6fdd0d86b8610b738fc15c707eedc00ec9dc.zip
frameworks_base-eccd6fdd0d86b8610b738fc15c707eedc00ec9dc.tar.gz
frameworks_base-eccd6fdd0d86b8610b738fc15c707eedc00ec9dc.tar.bz2
Merge change 20673 into donut
* changes: Fix bug 2043140. A race condition is encountered when an application invokes shutdown() on its TextToSpeech object while is has speak() requests still running. Since the TTS service destructor releases the synthesizer resources and sets the corresponding synth reference to null, an NPE was observed. The fix consists in catching NPEs whenever the sNativeSynth object is accessed, and return the matching error for the call. This change is a "low risk" version of the fix for bug 2025765i (same issue) which was reverted because it was higher risk than this CL: it affected the logic of each call to sNativeSynth. This CL only sets an error code when an NPE is fired because sNativeSynth is null.
Diffstat (limited to 'core/java')
-rwxr-xr-xcore/java/android/speech/tts/TextToSpeech.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/speech/tts/TextToSpeech.java b/core/java/android/speech/tts/TextToSpeech.java
index 04a0ec8..4405a53 100755
--- a/core/java/android/speech/tts/TextToSpeech.java
+++ b/core/java/android/speech/tts/TextToSpeech.java
@@ -1032,7 +1032,7 @@ public class TextToSpeech {
}
try {
String[] locStrings = mITts.getLanguage();
- if (locStrings.length == 3) {
+ if ((locStrings != null) && (locStrings.length == 3)) {
return new Locale(locStrings[0], locStrings[1], locStrings[2]);
} else {
return null;