Correct propagation of asynchonous events

The legacy plugin listener was not set when used in
passthrough mode in Treble. This caused events (session renewal,
key expired etc) not to be propagated to the app.

b/35375500

Test: In progress

Change-Id: I7d74b3320c82e22f67d3c804ee93f9b9791080b2
This commit is contained in:
Rahul Frias
2017-02-27 14:07:44 -08:00
parent 1daad90b81
commit 89437fbdd9

View File

@@ -321,6 +321,7 @@ namespace implementation {
Return<void> DrmPlugin::setListener(const sp<IDrmPluginListener>& listener) {
mListener = listener;
mLegacyPlugin->setListener(listener == NULL ? NULL : this);
return Void();
}
@@ -372,8 +373,10 @@ namespace implementation {
break;
}
if (sendEvent) {
mListener->sendEvent(eventType, toHidlVec(*sessionId),
toHidlVec(*data));
Vector<uint8_t> emptyVector;
mListener->sendEvent(eventType,
toHidlVec(sessionId == NULL ? emptyVector: *sessionId),
toHidlVec(data == NULL ? emptyVector: *data));
}
}