Loading media/libaudioclient/AudioEffect.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ AudioEffect::AudioEffect(const effect_uuid_t *type, ) : mStatus(NO_INIT), mOpPackageName(opPackageName) { AutoMutex lock(mConstructLock); mStatus = set(type, uuid, priority, cbf, user, sessionId, io); } Loading Loading @@ -85,6 +86,7 @@ AudioEffect::AudioEffect(const char *typeStr, } } AutoMutex lock(mConstructLock); mStatus = set(pType, pUuid, priority, cbf, user, sessionId, io); } Loading media/libaudioclient/include/media/AudioEffect.h +21 −0 Original line number Diff line number Diff line Loading @@ -494,6 +494,7 @@ protected: effect_descriptor_t mDescriptor; // effect descriptor int32_t mId; // system wide unique effect engine instance ID Mutex mLock; // Mutex for mEnabled access Mutex mConstructLock; // Mutex for integrality construction String16 mOpPackageName; // The package name used for app op checks. Loading @@ -520,12 +521,22 @@ private: virtual void controlStatusChanged(bool controlGranted) { sp<AudioEffect> effect = mEffect.promote(); if (effect != 0) { { // Got the mConstructLock means the construction of AudioEffect // has finished, we should release the mConstructLock immediately. AutoMutex lock(effect->mConstructLock); } effect->controlStatusChanged(controlGranted); } } virtual void enableStatusChanged(bool enabled) { sp<AudioEffect> effect = mEffect.promote(); if (effect != 0) { { // Got the mConstructLock means the construction of AudioEffect // has finished, we should release the mConstructLock immediately. AutoMutex lock(effect->mConstructLock); } effect->enableStatusChanged(enabled); } } Loading @@ -536,6 +547,11 @@ private: void *pReplyData) { sp<AudioEffect> effect = mEffect.promote(); if (effect != 0) { { // Got the mConstructLock means the construction of AudioEffect // has finished, we should release the mConstructLock immediately. AutoMutex lock(effect->mConstructLock); } effect->commandExecuted( cmdCode, cmdSize, pCmdData, replySize, pReplyData); } Loading @@ -545,6 +561,11 @@ private: virtual void binderDied(const wp<IBinder>& /*who*/) { sp<AudioEffect> effect = mEffect.promote(); if (effect != 0) { { // Got the mConstructLock means the construction of AudioEffect // has finished, we should release the mConstructLock immediately. AutoMutex lock(effect->mConstructLock); } effect->binderDied(); } } Loading Loading
media/libaudioclient/AudioEffect.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ AudioEffect::AudioEffect(const effect_uuid_t *type, ) : mStatus(NO_INIT), mOpPackageName(opPackageName) { AutoMutex lock(mConstructLock); mStatus = set(type, uuid, priority, cbf, user, sessionId, io); } Loading Loading @@ -85,6 +86,7 @@ AudioEffect::AudioEffect(const char *typeStr, } } AutoMutex lock(mConstructLock); mStatus = set(pType, pUuid, priority, cbf, user, sessionId, io); } Loading
media/libaudioclient/include/media/AudioEffect.h +21 −0 Original line number Diff line number Diff line Loading @@ -494,6 +494,7 @@ protected: effect_descriptor_t mDescriptor; // effect descriptor int32_t mId; // system wide unique effect engine instance ID Mutex mLock; // Mutex for mEnabled access Mutex mConstructLock; // Mutex for integrality construction String16 mOpPackageName; // The package name used for app op checks. Loading @@ -520,12 +521,22 @@ private: virtual void controlStatusChanged(bool controlGranted) { sp<AudioEffect> effect = mEffect.promote(); if (effect != 0) { { // Got the mConstructLock means the construction of AudioEffect // has finished, we should release the mConstructLock immediately. AutoMutex lock(effect->mConstructLock); } effect->controlStatusChanged(controlGranted); } } virtual void enableStatusChanged(bool enabled) { sp<AudioEffect> effect = mEffect.promote(); if (effect != 0) { { // Got the mConstructLock means the construction of AudioEffect // has finished, we should release the mConstructLock immediately. AutoMutex lock(effect->mConstructLock); } effect->enableStatusChanged(enabled); } } Loading @@ -536,6 +547,11 @@ private: void *pReplyData) { sp<AudioEffect> effect = mEffect.promote(); if (effect != 0) { { // Got the mConstructLock means the construction of AudioEffect // has finished, we should release the mConstructLock immediately. AutoMutex lock(effect->mConstructLock); } effect->commandExecuted( cmdCode, cmdSize, pCmdData, replySize, pReplyData); } Loading @@ -545,6 +561,11 @@ private: virtual void binderDied(const wp<IBinder>& /*who*/) { sp<AudioEffect> effect = mEffect.promote(); if (effect != 0) { { // Got the mConstructLock means the construction of AudioEffect // has finished, we should release the mConstructLock immediately. AutoMutex lock(effect->mConstructLock); } effect->binderDied(); } } Loading