summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGloria Wang <gwang@google.com>2011-01-11 14:55:56 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-11 14:55:56 -0800
commitac2652c25f5d2a38709131f7731651bc5819fed5 (patch)
treed8c86badbc1e53832fe2e3cf41f7970843c3f471
parentb03f5627d4e0d80ea7b185e0af1d8a5d19461325 (diff)
parent9cfc9eff42a0700029c39e89c38b52488845ad63 (diff)
downloadframeworks_av-ac2652c25f5d2a38709131f7731651bc5819fed5.zip
frameworks_av-ac2652c25f5d2a38709131f7731651bc5819fed5.tar.gz
frameworks_av-ac2652c25f5d2a38709131f7731651bc5819fed5.tar.bz2
am 9e0bb6d5: am 0544d059: Merge "DRM Framework bug fixes."
* commit '9e0bb6d5eef5dfe2da60c50f3aaa39512307d11d': DRM Framework bug fixes.
-rw-r--r--drm/drmserver/DrmManager.cpp6
-rw-r--r--drm/libdrmframework/DrmManagerClient.cpp1
-rw-r--r--drm/libdrmframework/DrmManagerClientImpl.cpp3
-rw-r--r--include/drm/DrmManagerClient.h3
4 files changed, 11 insertions, 2 deletions
diff --git a/drm/drmserver/DrmManager.cpp b/drm/drmserver/DrmManager.cpp
index 9a6f787..b6e0c30 100644
--- a/drm/drmserver/DrmManager.cpp
+++ b/drm/drmserver/DrmManager.cpp
@@ -117,7 +117,11 @@ status_t DrmManager::unloadPlugIns() {
status_t DrmManager::setDrmServiceListener(
int uniqueId, const sp<IDrmServiceListener>& drmServiceListener) {
Mutex::Autolock _l(mLock);
- mServiceListeners.add(uniqueId, drmServiceListener);
+ if (NULL != drmServiceListener.get()) {
+ mServiceListeners.add(uniqueId, drmServiceListener);
+ } else {
+ mServiceListeners.removeItem(uniqueId);
+ }
return DRM_NO_ERROR;
}
diff --git a/drm/libdrmframework/DrmManagerClient.cpp b/drm/libdrmframework/DrmManagerClient.cpp
index 578e135..7b51822 100644
--- a/drm/libdrmframework/DrmManagerClient.cpp
+++ b/drm/libdrmframework/DrmManagerClient.cpp
@@ -31,6 +31,7 @@ DrmManagerClient::DrmManagerClient():
DrmManagerClient::~DrmManagerClient() {
DrmManagerClientImpl::remove(mUniqueId);
mDrmManagerClientImpl->removeClient(mUniqueId);
+ mDrmManagerClientImpl->setOnInfoListener(mUniqueId, NULL);
delete mDrmManagerClientImpl; mDrmManagerClientImpl = NULL;
}
diff --git a/drm/libdrmframework/DrmManagerClientImpl.cpp b/drm/libdrmframework/DrmManagerClientImpl.cpp
index f39131d..d20de92 100644
--- a/drm/libdrmframework/DrmManagerClientImpl.cpp
+++ b/drm/libdrmframework/DrmManagerClientImpl.cpp
@@ -81,7 +81,8 @@ status_t DrmManagerClientImpl::setOnInfoListener(
int uniqueId, const sp<DrmManagerClient::OnInfoListener>& infoListener) {
Mutex::Autolock _l(mLock);
mOnInfoListener = infoListener;
- return getDrmManagerService()->setDrmServiceListener(uniqueId, this);
+ return getDrmManagerService()->setDrmServiceListener(uniqueId,
+ (NULL != infoListener.get()) ? this : NULL);
}
status_t DrmManagerClientImpl::installDrmEngine(int uniqueId, const String8& drmEngineFile) {
diff --git a/include/drm/DrmManagerClient.h b/include/drm/DrmManagerClient.h
index e6ba3c4..085ebf1 100644
--- a/include/drm/DrmManagerClient.h
+++ b/include/drm/DrmManagerClient.h
@@ -49,6 +49,9 @@ public:
class OnInfoListener: virtual public RefBase {
public:
+ virtual ~OnInfoListener() {}
+
+ public:
virtual void onInfo(const DrmInfoEvent& event) = 0;
};