Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 283eb4fc authored by Kyle Zhang's avatar Kyle Zhang
Browse files

Add crypto scheme check when create drm plugin

Bug: 330819085
Change-Id: Ica19e221e7ad5e939396cacafeb53f970855ca2f
parent e2420d26
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -466,6 +466,12 @@ DrmStatus DrmHalAidl::createPlugin(const uint8_t uuid[16], const String8& appPac
    mMetrics->SetAppPackageName(appPackageName);
    mMetrics->SetAppUid(AIBinder_getCallingUid());
    for (ssize_t i = mFactories.size() - 1; i >= 0; i--) {
        CryptoSchemes schemes{};
        auto err = mFactories[i]->getSupportedCryptoSchemes(&schemes);
        if (!err.isOk() || !std::count(schemes.uuids.begin(), schemes.uuids.end(), uuidAidl)) {
            continue;
        }

        ::ndk::ScopedAStatus status =
                mFactories[i]->createDrmPlugin(uuidAidl, appPackageNameAidl, &pluginAidl);
        if (status.isOk()) {