Merge "wvcdm: filter logs by app uid" into sc-dev am: 1f796bc4e3

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13577645

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie9084b3e16655257555a3fbdd6b2cf1644f8d834
This commit is contained in:
Robert Shih
2021-03-02 10:44:05 +00:00
committed by Automerger Merge Worker
19 changed files with 127 additions and 16 deletions

View File

@@ -10,6 +10,7 @@
#include <android/hidl/memory/1.0/IMemory.h>
#include "HidlTypes.h"
#include "log.h"
#include "wv_content_decryption_module.h"
#include "WVTypes.h"
@@ -24,7 +25,7 @@ using ::android::hidl::memory::V1_0::IMemory;
struct WVCryptoPlugin : public ::drm::V1_4::ICryptoPlugin {
WVCryptoPlugin(const void* data, size_t size,
const sp<wvcdm::WvContentDecryptionModule>& cdm);
virtual ~WVCryptoPlugin() {}
virtual ~WVCryptoPlugin();
Return<bool> requiresSecureDecoderComponent(const hidl_string& mime)
override;
@@ -67,10 +68,15 @@ struct WVCryptoPlugin : public ::drm::V1_4::ICryptoPlugin {
private:
WVDRM_DISALLOW_COPY_AND_ASSIGN_AND_NEW(WVCryptoPlugin);
// List this field first so it is destructed last; ensure logging uid
// is cleared right before plugin is destructed.
wvcdm::LoggingUidSetter mLoggingUidSetter;
wvcdm::CdmSessionId mSessionId;
std::map<uint32_t, sp<IMemory> > mSharedBufferMap;
sp<wvcdm::WvContentDecryptionModule> const mCDM;
uint32_t mUserId;
Status_V1_2 attemptDecrypt(
const wvcdm::CdmDecryptionParametersV16& params,

View File

@@ -15,6 +15,7 @@
#include <iterator>
#include "HidlTypes.h"
#include "log.h"
#include "mapErrors-inl.h"
#include "OEMCryptoCENC.h"
#include "openssl/sha.h"
@@ -56,12 +57,21 @@ using wvcdm::WvContentDecryptionModule;
WVCryptoPlugin::WVCryptoPlugin(const void* data, size_t size,
const sp<WvContentDecryptionModule>& cdm)
: mCDM(cdm){
: mCDM(cdm),
mUserId(wvcdm::UNKNOWN_UID) {
if (data != NULL) {
mSessionId.assign(static_cast<const char *>(data), size);
}
if (!mCDM->IsOpenSession(mSessionId)) {
mSessionId.clear();
} else {
mCDM->GetSessionUserId(mSessionId, &mUserId);
}
}
WVCryptoPlugin::~WVCryptoPlugin() {
if (wvcdm::UNKNOWN_UID != mUserId) {
wvcdm::SetLoggingUid(mUserId);
}
}

View File

@@ -35,6 +35,7 @@ LOCAL_SHARED_LIBRARIES := \
libcrypto \
libcutils \
libdl \
libhidlbase \
liblog \
libprotobuf-cpp-lite \
libstagefright_foundation \