diff --git a/drm/1.0/default/CryptoPlugin.h b/drm/1.0/default/CryptoPlugin.h index 5da469ce85..11cc2aae47 100644 --- a/drm/1.0/default/CryptoPlugin.h +++ b/drm/1.0/default/CryptoPlugin.h @@ -44,7 +44,7 @@ using ::android::sp; struct CryptoPlugin : public ICryptoPlugin { CryptoPlugin(android::CryptoPlugin *plugin) : mLegacyPlugin(plugin) {} - virtual ~CryptoPlugin() {delete mLegacyPlugin;} + ~CryptoPlugin() {delete mLegacyPlugin;} // Methods from ::android::hardware::drm::V1_0::ICryptoPlugin // follow. diff --git a/drm/1.0/default/DrmFactory.cpp b/drm/1.0/default/DrmFactory.cpp index 05951d7c02..7e5d998e4f 100644 --- a/drm/1.0/default/DrmFactory.cpp +++ b/drm/1.0/default/DrmFactory.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2016 The Android Open Source Project - * +` * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/drm/1.0/default/DrmPlugin.cpp b/drm/1.0/default/DrmPlugin.cpp index 1feec0a32c..1695ef7726 100644 --- a/drm/1.0/default/DrmPlugin.cpp +++ b/drm/1.0/default/DrmPlugin.cpp @@ -327,27 +327,24 @@ namespace implementation { Return DrmPlugin::sendEvent(EventType eventType, const hidl_vec& sessionId, const hidl_vec& data) { - auto listener = mListener.promote(); - if (listener != nullptr) { - listener->sendEvent(eventType, sessionId, data); + if (mListener != nullptr) { + mListener->sendEvent(eventType, sessionId, data); } return Void(); } Return DrmPlugin::sendExpirationUpdate( const hidl_vec& sessionId, int64_t expiryTimeInMS) { - auto listener = mListener.promote(); - if (listener != nullptr) { - listener->sendExpirationUpdate(sessionId, expiryTimeInMS); + if (mListener != nullptr) { + mListener->sendExpirationUpdate(sessionId, expiryTimeInMS); } return Void(); } Return DrmPlugin::sendKeysChange(const hidl_vec& sessionId, const hidl_vec& keyStatusList, bool hasNewUsableKey) { - auto listener = mListener.promote(); - if (listener != nullptr) { - listener->sendKeysChange(sessionId, keyStatusList, hasNewUsableKey); + if (mListener != nullptr) { + mListener->sendKeysChange(sessionId, keyStatusList, hasNewUsableKey); } return Void(); } @@ -383,21 +380,15 @@ namespace implementation { } if (sendEvent) { Vector emptyVector; - auto listener = mListener.promote(); - if (listener != nullptr) { - listener->sendEvent(eventType, - toHidlVec(sessionId == NULL ? emptyVector: *sessionId), - toHidlVec(data == NULL ? emptyVector: *data)); - } + mListener->sendEvent(eventType, + toHidlVec(sessionId == NULL ? emptyVector: *sessionId), + toHidlVec(data == NULL ? emptyVector: *data)); } } void DrmPlugin::sendExpirationUpdate(Vector const *sessionId, int64_t expiryTimeInMS) { - auto listener = mListener.promote(); - if (listener != nullptr) { - listener->sendExpirationUpdate(toHidlVec(*sessionId), expiryTimeInMS); - } + mListener->sendExpirationUpdate(toHidlVec(*sessionId), expiryTimeInMS); } void DrmPlugin::sendKeysChange(Vector const *sessionId, @@ -433,11 +424,8 @@ namespace implementation { keyStatus.keyId = toHidlVec(legacyKeyStatus.mKeyId); keyStatusVec.push_back(keyStatus); } - auto listener = mListener.promote(); - if (listener != nullptr) { - listener->sendKeysChange(toHidlVec(*sessionId), - toHidlVec(keyStatusVec), hasNewUsableKey); - } + mListener->sendKeysChange(toHidlVec(*sessionId), + toHidlVec(keyStatusVec), hasNewUsableKey); } } // namespace implementation diff --git a/drm/1.0/default/DrmPlugin.h b/drm/1.0/default/DrmPlugin.h index d951c9260c..dce6c0c62a 100644 --- a/drm/1.0/default/DrmPlugin.h +++ b/drm/1.0/default/DrmPlugin.h @@ -46,7 +46,7 @@ using ::android::sp; struct DrmPlugin : public IDrmPlugin, android::DrmPluginListener { DrmPlugin(android::DrmPlugin *plugin) : mLegacyPlugin(plugin) {} - virtual ~DrmPlugin() {delete mLegacyPlugin;} + ~DrmPlugin() {delete mLegacyPlugin;} // Methods from ::android::hardware::drm::V1_0::IDrmPlugin follow. @@ -153,7 +153,7 @@ struct DrmPlugin : public IDrmPlugin, android::DrmPluginListener { private: android::DrmPlugin *mLegacyPlugin; - wp mListener; + sp mListener; DrmPlugin() = delete; DrmPlugin(const DrmPlugin &) = delete;