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:
Edwin Wong
2022-07-30 01:50:48 +00:00
parent 6a0d1ce668
commit 6797b8eb8a
8 changed files with 26 additions and 4 deletions

View File

@@ -30,7 +30,6 @@ int main(int /* argc */, char** /* argv */) {
ABinderProcess_setThreadPoolMaxThreadCount(8);
std::shared_ptr<WVDrmFactory> drmFactory = createDrmFactory();
AIBinder_setRequestingSid(drmFactory->asBinder().get(), true);
const std::string drmInstance =
std::string(WVDrmFactory::descriptor) + "/widevine";