Loading services/audioflinger/Threads.cpp +15 −14 Original line number Diff line number Diff line Loading @@ -10663,6 +10663,16 @@ NO_THREAD_SAFETY_ANALYSIS // elease and re-acquire mutex() } } // For mmap streams, once the routing has changed, they will be disconnected. It should be // okay to notify the client earlier before the new patch creation. if (mDeviceId != deviceId) { if (const sp<MmapStreamCallback> callback = mCallback.promote()) { // The aaudioservice handle the routing changed event asynchronously. In that case, // it is safe to hold the lock here. callback->onRoutingChanged(deviceId); } } if (mAudioHwDev->supportsAudioPatches()) { status = mHalDevice->createAudioPatch(patch->num_sources, patch->sources, patch->num_sinks, patch->sinks, handle); Loading @@ -10688,12 +10698,6 @@ NO_THREAD_SAFETY_ANALYSIS // elease and re-acquire mutex() sendIoConfigEvent_l(AUDIO_INPUT_CONFIG_CHANGED); mInDeviceTypeAddr = sourceDeviceTypeAddr; } sp<MmapStreamCallback> callback = mCallback.promote(); if (mDeviceId != deviceId && callback != 0) { mutex().unlock(); callback->onRoutingChanged(deviceId); mutex().lock(); } mPatch = *patch; mDeviceId = deviceId; } Loading Loading @@ -10845,22 +10849,19 @@ status_t MmapThread::checkEffectCompatibility_l( void MmapThread::checkInvalidTracks_l() { sp<MmapStreamCallback> callback; for (const sp<IAfMmapTrack>& track : mActiveTracks) { if (track->isInvalid()) { callback = mCallback.promote(); if (callback == nullptr && mNoCallbackWarningCount < kMaxNoCallbackWarnings) { if (const sp<MmapStreamCallback> callback = mCallback.promote()) { // The aaudioservice handle the routing changed event asynchronously. In that case, // it is safe to hold the lock here. callback->onRoutingChanged(AUDIO_PORT_HANDLE_NONE); } else if (mNoCallbackWarningCount < kMaxNoCallbackWarnings) { ALOGW("Could not notify MMAP stream tear down: no onRoutingChanged callback!"); mNoCallbackWarningCount++; } break; } } if (callback != 0) { mutex().unlock(); callback->onRoutingChanged(AUDIO_PORT_HANDLE_NONE); mutex().lock(); } } void MmapThread::dumpInternals_l(int fd, const Vector<String16>& /* args */) Loading Loading
services/audioflinger/Threads.cpp +15 −14 Original line number Diff line number Diff line Loading @@ -10663,6 +10663,16 @@ NO_THREAD_SAFETY_ANALYSIS // elease and re-acquire mutex() } } // For mmap streams, once the routing has changed, they will be disconnected. It should be // okay to notify the client earlier before the new patch creation. if (mDeviceId != deviceId) { if (const sp<MmapStreamCallback> callback = mCallback.promote()) { // The aaudioservice handle the routing changed event asynchronously. In that case, // it is safe to hold the lock here. callback->onRoutingChanged(deviceId); } } if (mAudioHwDev->supportsAudioPatches()) { status = mHalDevice->createAudioPatch(patch->num_sources, patch->sources, patch->num_sinks, patch->sinks, handle); Loading @@ -10688,12 +10698,6 @@ NO_THREAD_SAFETY_ANALYSIS // elease and re-acquire mutex() sendIoConfigEvent_l(AUDIO_INPUT_CONFIG_CHANGED); mInDeviceTypeAddr = sourceDeviceTypeAddr; } sp<MmapStreamCallback> callback = mCallback.promote(); if (mDeviceId != deviceId && callback != 0) { mutex().unlock(); callback->onRoutingChanged(deviceId); mutex().lock(); } mPatch = *patch; mDeviceId = deviceId; } Loading Loading @@ -10845,22 +10849,19 @@ status_t MmapThread::checkEffectCompatibility_l( void MmapThread::checkInvalidTracks_l() { sp<MmapStreamCallback> callback; for (const sp<IAfMmapTrack>& track : mActiveTracks) { if (track->isInvalid()) { callback = mCallback.promote(); if (callback == nullptr && mNoCallbackWarningCount < kMaxNoCallbackWarnings) { if (const sp<MmapStreamCallback> callback = mCallback.promote()) { // The aaudioservice handle the routing changed event asynchronously. In that case, // it is safe to hold the lock here. callback->onRoutingChanged(AUDIO_PORT_HANDLE_NONE); } else if (mNoCallbackWarningCount < kMaxNoCallbackWarnings) { ALOGW("Could not notify MMAP stream tear down: no onRoutingChanged callback!"); mNoCallbackWarningCount++; } break; } } if (callback != 0) { mutex().unlock(); callback->onRoutingChanged(AUDIO_PORT_HANDLE_NONE); mutex().lock(); } } void MmapThread::dumpInternals_l(int fd, const Vector<String16>& /* args */) Loading