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:
@@ -46,6 +46,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,
|
||||
@@ -66,7 +73,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);
|
||||
}
|
||||
@@ -99,7 +105,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user