- Some change on the DrmManager in order to support feature request 4082089.
In DrmManager, we currently lock both processDrmInfo() and onInfo() which is
ok for now since processDrmInfo() is async call, and it will return without
waiting for onInfo() call. However, if we send an event in processDrmInfo(),
we will got deadlock here because we need to invoke onInf() which will wait
for processDrmInfo() to release the lock. Use different lock for onInfo().
- Remove some redundent mutex lock.
Change-Id: I59c794f95ba1693425723224114fa975cf9b235f
diff --git a/drm/drmserver/DrmManager.cpp b/drm/drmserver/DrmManager.cpp
index 305bafc..1eee5f2 100644
--- a/drm/drmserver/DrmManager.cpp
+++ b/drm/drmserver/DrmManager.cpp
@@ -119,7 +119,7 @@
status_t DrmManager::setDrmServiceListener(
int uniqueId, const sp<IDrmServiceListener>& drmServiceListener) {
- Mutex::Autolock _l(mLock);
+ Mutex::Autolock _l(mListenerLock);
if (NULL != drmServiceListener.get()) {
mServiceListeners.add(uniqueId, drmServiceListener);
} else {
@@ -573,7 +573,7 @@
}
void DrmManager::onInfo(const DrmInfoEvent& event) {
- Mutex::Autolock _l(mLock);
+ Mutex::Autolock _l(mListenerLock);
for (unsigned int index = 0; index < mServiceListeners.size(); index++) {
int uniqueId = mServiceListeners.keyAt(index);