Call AIBinder_setRequestingSid from createBinder override function
AIBinder_setRequestingSid must be called first upon creation of a binder object before AIBinder_getCallingSid is called. Call AIBinder_setRequestingSid in the createBinder override function for WVDrmFactory, WVDrmPlugin and WVCryptoPlugin classes. Test: Play TV streaming Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -a Bug: 237613676 Change-Id: I9dde4715ba2003deb463bd75b23e1ebc2f22a764
This commit is contained in:
@@ -76,6 +76,8 @@ class WVCryptoPlugin : public ::aidl::android::hardware::drm::BnCryptoPlugin {
|
||||
::android::sp<wvcdm::WvContentDecryptionModule> const mCDM;
|
||||
uint32_t mUserId;
|
||||
|
||||
::ndk::SpAIBinder createBinder() override;
|
||||
|
||||
::aidl::android::hardware::drm::Status attemptDecrypt(
|
||||
const wvcdm::CdmDecryptionParametersV16& params,
|
||||
bool haveEncryptedSubsamples, std::string* errorDetailMsg);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "WVCryptoPlugin.h"
|
||||
|
||||
#include <aidlcommonsupport/NativeHandle.h>
|
||||
#include <android/binder_ibinder_platform.h>
|
||||
#include <sys/mman.h>
|
||||
#include <utils/Log.h>
|
||||
|
||||
@@ -289,6 +290,12 @@ SharedBufferBase::~SharedBufferBase() {
|
||||
return toNdkScopedAStatus(Status::OK, detailedError);
|
||||
}
|
||||
|
||||
::ndk::SpAIBinder WVCryptoPlugin::createBinder() {
|
||||
auto binder = BnCryptoPlugin::createBinder();
|
||||
AIBinder_setRequestingSid(binder.get(), true);
|
||||
return binder;
|
||||
}
|
||||
|
||||
Status WVCryptoPlugin::attemptDecrypt(const CdmDecryptionParametersV16& params,
|
||||
bool hasProtectedData,
|
||||
std::string* errorDetailMsg) {
|
||||
|
||||
Reference in New Issue
Block a user