hwc: Get notified on media player death.
Add support to get notified of media player death.
This is useful in reseting secure sessions initiated by mediaserver.
Change-Id: I215b5b552a0874c86a07426cd7d16ed48f307b5d
diff --git a/libhwcomposer/hwc_qclient.cpp b/libhwcomposer/hwc_qclient.cpp
index 32dc451..ee31e6c 100644
--- a/libhwcomposer/hwc_qclient.cpp
+++ b/libhwcomposer/hwc_qclient.cpp
@@ -39,9 +39,14 @@
namespace qClient {
// ----------------------------------------------------------------------------
-QClient::QClient(hwc_context_t *ctx) : mHwcContext(ctx)
+QClient::QClient(hwc_context_t *ctx) : mHwcContext(ctx),
+ mMPDeathNotifier(new MPDeathNotifier(ctx))
{
+
ALOGD_IF(QCLIENT_DEBUG, "QClient Constructor invoked");
+ //The only way to make this class in this process subscribe to media
+ //player's death.
+ IMediaDeathNotifier::getMediaPlayerService();
}
QClient::~QClient()
@@ -80,4 +85,12 @@
mHwcContext->proc->invalidate(mHwcContext->proc);
}
+void QClient::MPDeathNotifier::died() {
+ ALOGD_IF(QCLIENT_DEBUG, "Media Player died");
+ mHwcContext->mSecuring = false;
+ mHwcContext->mSecureMode = false;
+ if(mHwcContext->proc)
+ mHwcContext->proc->invalidate(mHwcContext->proc);
+}
+
}