summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/Drm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'media/libmediaplayerservice/Drm.cpp')
-rw-r--r--media/libmediaplayerservice/Drm.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/Drm.cpp b/media/libmediaplayerservice/Drm.cpp
index 1e6cd94..f00f488 100644
--- a/media/libmediaplayerservice/Drm.cpp
+++ b/media/libmediaplayerservice/Drm.cpp
@@ -71,6 +71,12 @@ status_t Drm::initCheck() const {
status_t Drm::setListener(const sp<IDrmClient>& listener)
{
Mutex::Autolock lock(mEventLock);
+ if (mListener != NULL){
+ mListener->asBinder()->unlinkToDeath(this);
+ }
+ if (listener != NULL) {
+ listener->asBinder()->linkToDeath(this);
+ }
mListener = listener;
return NO_ERROR;
}
@@ -576,4 +582,12 @@ status_t Drm::verify(Vector<uint8_t> const &sessionId,
return mPlugin->verify(sessionId, keyId, message, signature, match);
}
+void Drm::binderDied(const wp<IBinder> &the_late_who)
+{
+ delete mPlugin;
+ mPlugin = NULL;
+ closeFactory();
+ mListener.clear();
+}
+
} // namespace android