diff --git a/media/libaudioclient/AudioSystem.cpp b/media/libaudioclient/AudioSystem.cpp index 74fa343427..6357da4316 100644 --- a/media/libaudioclient/AudioSystem.cpp +++ b/media/libaudioclient/AudioSystem.cpp @@ -55,6 +55,7 @@ const sp AudioSystem::get_audio_flinger() { sp af; sp afc; + bool reportNoError = false; { Mutex::Autolock _l(gLock); if (gAudioFlinger == 0) { @@ -70,7 +71,7 @@ const sp AudioSystem::get_audio_flinger() if (gAudioFlingerClient == NULL) { gAudioFlingerClient = new AudioFlingerClient(); } else { - reportError(NO_ERROR); + reportNoError = true; } binder->linkToDeath(gAudioFlingerClient); gAudioFlinger = interface_cast(binder); @@ -86,6 +87,7 @@ const sp AudioSystem::get_audio_flinger() af->registerClient(afc); IPCThreadState::self()->restoreCallingIdentity(token); } + if (reportNoError) reportError(NO_ERROR); return af; }