Merge "Fix issue 2363154: Speech synthesis fails to start over A2DP after media server process crash."
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp
index 5352234..e1b1776 100644
--- a/media/libmedia/AudioSystem.cpp
+++ b/media/libmedia/AudioSystem.cpp
@@ -348,6 +348,9 @@
Mutex::Autolock _l(AudioSystem::gLock);
AudioSystem::gAudioFlinger.clear();
+ // clear output handles and stream to output map caches
+ AudioSystem::gStreamOutputMap.clear();
+ AudioSystem::gOutputs.clear();
if (gAudioErrorCallback) {
gAudioErrorCallback(DEAD_OBJECT);