Merge "Call AIBinder_setRequestingSid from createBinder override function" into tm-widevine-release

This commit is contained in:
TreeHugger Robot
2023-03-07 22:52:39 +00:00
committed by Android (Google) Code Review
8 changed files with 26 additions and 4 deletions

View File

@@ -47,6 +47,13 @@ bool WVDrmFactory::isCryptoSchemeSupported(const Uuid& in_uuid) {
return isWidevineUUID(in_uuid.uuid.data());
}
::ndk::SpAIBinder WVDrmFactory::createBinder() {
auto binder = BnDrmFactory::createBinder();
AIBinder_setRequestingSid(binder.get(), true);
return binder;
}
::ndk::ScopedAStatus WVDrmFactory::createCryptoPlugin(
const ::aidl::android::hardware::drm::Uuid& in_uuid,
const std::vector<uint8_t>& in_initData,
@@ -67,7 +74,6 @@ bool WVDrmFactory::isCryptoSchemeSupported(const Uuid& in_uuid) {
std::shared_ptr<WVCryptoPlugin> plugin =
::ndk::SharedRefBase::make<WVCryptoPlugin>(in_initData.data(),
in_initData.size(), getCDM());
AIBinder_setRequestingSid(plugin->asBinder().get(), true);
*_aidl_return = std::move(plugin);
return toNdkScopedAStatus(Status::OK);
}
@@ -100,7 +106,6 @@ bool WVDrmFactory::isCryptoSchemeSupported(const Uuid& in_uuid) {
getCDM(), in_appPackageName.c_str(), &sOemCryptoInterface,
areSpoidsEnabled());
AIBinder_setRequestingSid(plugin->asBinder().get(), true);
*_aidl_return = plugin;
return toNdkScopedAStatus(Status::OK);
}