summaryrefslogtreecommitdiff
path: root/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2009-08-03 10:50:51 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2009-08-03 11:07:46 -0700
commit9ebb59b8aa75cab1e5bb53983893b579abb63edd (patch)
tree2e1397154b6779735bf0d5b963a726f505cad374 /tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java
parentc134c281ca83a28deb96c7b338c48c0b0327f26f (diff)
Fix bug 2025765.
Talkback produced a null pointer exception when being enabled and disabled repeatedly due to a race condition between the onDestroy() of the service, and the use of the service itself. The error occurs when one Talkback thread initiates the destruction of the service (call to onDestroy()) when it invokes shutdown() on its TextToSpeech instance (the client of the service). At the same time, Talkback tries to say that "Accessibility" is unchecked from another thread. During onDestroy(), the reference to the TTS engine (sNativeSynth) is reset to null, which is used in the service in speakInternalOnly(), and setLanguage(). The fix consists in the addition of a static variable that signals that the service has entered onDestroy(). Once this flag is set, all method invocations on sNativeSynth will be dismissed. Note that access to the native resources used by sNativeSynth are synchronized at the native layer, therefore preventing sNativeSynth.shutdown() to interfere with a sNativeSynth.speak() call already underway.
Diffstat (limited to 'tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java')
0 files changed, 0 insertions, 0 deletions