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

Commit 50a5b0b1 authored by Kyle Zhang's avatar Kyle Zhang Committed by Android (Google) Code Review
Browse files

Merge "Add crypto scheme check when create drm plugin" into main

parents 7dbf9627 283eb4fc
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()) {