Merge "Fix widevine drm hal resource leaks" into oc-dev am: 27deb32b79
am: d5934a8af4
Change-Id: If64712e19cc2a5d18b565b9a830ba5877c12d567
This commit is contained in:
@@ -38,6 +38,7 @@ using ::android::hardware::hidl_string;
|
|||||||
using ::android::hardware::hidl_vec;
|
using ::android::hardware::hidl_vec;
|
||||||
using ::android::hardware::Return;
|
using ::android::hardware::Return;
|
||||||
using ::android::sp;
|
using ::android::sp;
|
||||||
|
using ::android::wp;
|
||||||
|
|
||||||
using android::status_t;
|
using android::status_t;
|
||||||
using std::map;
|
using std::map;
|
||||||
@@ -350,7 +351,7 @@ struct WVDrmPlugin : public IDrmPlugin, IDrmPluginListener,
|
|||||||
sp<wvcdm::WvContentDecryptionModule> const mCDM;
|
sp<wvcdm::WvContentDecryptionModule> const mCDM;
|
||||||
WVGenericCryptoInterface* mCrypto;
|
WVGenericCryptoInterface* mCrypto;
|
||||||
map<CdmSessionId, CryptoSession> mCryptoSessions;
|
map<CdmSessionId, CryptoSession> mCryptoSessions;
|
||||||
sp<IDrmPluginListener> mListener;
|
wp<IDrmPluginListener> mListener;
|
||||||
|
|
||||||
status_t queryProperty(const std::string& property,
|
status_t queryProperty(const std::string& property,
|
||||||
std::string& stringValue) const;
|
std::string& stringValue) const;
|
||||||
|
|||||||
@@ -1122,8 +1122,9 @@ Return<void> WVDrmPlugin::setListener(const sp<IDrmPluginListener>& listener) {
|
|||||||
Return<void> WVDrmPlugin::sendEvent(
|
Return<void> WVDrmPlugin::sendEvent(
|
||||||
EventType eventType,
|
EventType eventType,
|
||||||
const hidl_vec<uint8_t>& sessionId, const hidl_vec<uint8_t>& data) {
|
const hidl_vec<uint8_t>& sessionId, const hidl_vec<uint8_t>& data) {
|
||||||
if (mListener != NULL) {
|
auto listener = mListener.promote();
|
||||||
mListener->sendEvent(eventType, sessionId, data);
|
if (listener != NULL) {
|
||||||
|
listener->sendEvent(eventType, sessionId, data);
|
||||||
} else {
|
} else {
|
||||||
ALOGE("Null event listener, event not sent");
|
ALOGE("Null event listener, event not sent");
|
||||||
}
|
}
|
||||||
@@ -1133,8 +1134,9 @@ Return<void> WVDrmPlugin::sendEvent(
|
|||||||
Return<void> WVDrmPlugin::sendExpirationUpdate(
|
Return<void> WVDrmPlugin::sendExpirationUpdate(
|
||||||
const hidl_vec<uint8_t>& sessionId,
|
const hidl_vec<uint8_t>& sessionId,
|
||||||
int64_t expiryTimeInMS) {
|
int64_t expiryTimeInMS) {
|
||||||
if (mListener != NULL) {
|
auto listener = mListener.promote();
|
||||||
mListener->sendExpirationUpdate(sessionId, expiryTimeInMS);
|
if (listener != NULL) {
|
||||||
|
listener->sendExpirationUpdate(sessionId, expiryTimeInMS);
|
||||||
} else {
|
} else {
|
||||||
ALOGE("Null event listener, event not sent");
|
ALOGE("Null event listener, event not sent");
|
||||||
}
|
}
|
||||||
@@ -1144,8 +1146,9 @@ Return<void> WVDrmPlugin::sendExpirationUpdate(
|
|||||||
Return<void> WVDrmPlugin::sendKeysChange(
|
Return<void> WVDrmPlugin::sendKeysChange(
|
||||||
const hidl_vec<uint8_t>& sessionId,
|
const hidl_vec<uint8_t>& sessionId,
|
||||||
const hidl_vec<KeyStatus>& keyStatusList, bool hasNewUsableKey) {
|
const hidl_vec<KeyStatus>& keyStatusList, bool hasNewUsableKey) {
|
||||||
if (mListener != NULL) {
|
auto listener = mListener.promote();
|
||||||
mListener->sendKeysChange(sessionId, keyStatusList, hasNewUsableKey);
|
if (listener != NULL) {
|
||||||
|
listener->sendKeysChange(sessionId, keyStatusList, hasNewUsableKey);
|
||||||
} else {
|
} else {
|
||||||
ALOGE("Null event listener, event not sent");
|
ALOGE("Null event listener, event not sent");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user