pal: release RM mutex before calling device setParam for A2dpSuspend
If some thread has acquired activeStreamMutex and is waiting for RM mutex.
If we will call a2dpSuspend device setParam with RM mutex held, deadlock
condition might happen as a2dpSuspend needs to get active streams over A2dp
which requires activeStreamMutex.
Thus, releasing RM mutex before calling device setParam for A2dpSuspend.
Change-Id: I0288b2511ac1788efd2b02d4742eee071eef6a8b
diff --git a/resource_manager/src/ResourceManager.cpp b/resource_manager/src/ResourceManager.cpp
index 91d1061..133e387 100644
--- a/resource_manager/src/ResourceManager.cpp
+++ b/resource_manager/src/ResourceManager.cpp
@@ -9057,8 +9057,10 @@
param_bt_a2dp.dev_id = PAL_DEVICE_OUT_BLUETOOTH_A2DP;
param_bt_a2dp.a2dp_suspended = true;
PAL_DBG(LOG_TAG, "Applying cached a2dp_suspended true param");
+ mResourceManagerMutex.unlock();
status = dev->setDeviceParameter(PAL_PARAM_ID_BT_A2DP_SUSPENDED,
¶m_bt_a2dp);
+ mResourceManagerMutex.lock();
} else {
a2dp_suspended = false;
}