Merge "Move AudioSystem errorCallback call out from gLock" into rvc-dev

gugelfrei
TreeHugger Robot 4 years ago committed by Android (Google) Code Review
commit 0428fecb64

@ -55,6 +55,7 @@ const sp<IAudioFlinger> AudioSystem::get_audio_flinger()
{ {
sp<IAudioFlinger> af; sp<IAudioFlinger> af;
sp<AudioFlingerClient> afc; sp<AudioFlingerClient> afc;
bool reportNoError = false;
{ {
Mutex::Autolock _l(gLock); Mutex::Autolock _l(gLock);
if (gAudioFlinger == 0) { if (gAudioFlinger == 0) {
@ -70,7 +71,7 @@ const sp<IAudioFlinger> AudioSystem::get_audio_flinger()
if (gAudioFlingerClient == NULL) { if (gAudioFlingerClient == NULL) {
gAudioFlingerClient = new AudioFlingerClient(); gAudioFlingerClient = new AudioFlingerClient();
} else { } else {
reportError(NO_ERROR); reportNoError = true;
} }
binder->linkToDeath(gAudioFlingerClient); binder->linkToDeath(gAudioFlingerClient);
gAudioFlinger = interface_cast<IAudioFlinger>(binder); gAudioFlinger = interface_cast<IAudioFlinger>(binder);
@ -86,6 +87,7 @@ const sp<IAudioFlinger> AudioSystem::get_audio_flinger()
af->registerClient(afc); af->registerClient(afc);
IPCThreadState::self()->restoreCallingIdentity(token); IPCThreadState::self()->restoreCallingIdentity(token);
} }
if (reportNoError) reportError(NO_ERROR);
return af; return af;
} }

Loading…
Cancel
Save