Loading media/jni/android_media_MediaDrm.cpp +2 −12 Original line number Diff line number Diff line Loading @@ -1003,19 +1003,9 @@ DrmPlugin::SecurityLevel jintToSecurityLevel(jint jlevel) { } static jbyteArray android_media_MediaDrm_getSupportedCryptoSchemesNative(JNIEnv *env) { sp<IDrm> drm = android::DrmUtils::MakeDrm(); std::vector<uint8_t> bv; for (auto &factory : DrmUtils::MakeDrmFactories()) { sp<drm::V1_3::IDrmFactory> factoryV1_3 = drm::V1_3::IDrmFactory::castFrom(factory); if (factoryV1_3 == nullptr) { continue; } factoryV1_3->getSupportedCryptoSchemes( [&](const hardware::hidl_vec<hardware::hidl_array<uint8_t, 16>>& schemes) { for (const auto &scheme : schemes) { bv.insert(bv.end(), scheme.data(), scheme.data() + scheme.size()); } }); } drm->getSupportedSchemes(bv); jbyteArray jUuidBytes = env->NewByteArray(bv.size()); env->SetByteArrayRegion(jUuidBytes, 0, bv.size(), reinterpret_cast<const jbyte *>(bv.data())); Loading Loading
media/jni/android_media_MediaDrm.cpp +2 −12 Original line number Diff line number Diff line Loading @@ -1003,19 +1003,9 @@ DrmPlugin::SecurityLevel jintToSecurityLevel(jint jlevel) { } static jbyteArray android_media_MediaDrm_getSupportedCryptoSchemesNative(JNIEnv *env) { sp<IDrm> drm = android::DrmUtils::MakeDrm(); std::vector<uint8_t> bv; for (auto &factory : DrmUtils::MakeDrmFactories()) { sp<drm::V1_3::IDrmFactory> factoryV1_3 = drm::V1_3::IDrmFactory::castFrom(factory); if (factoryV1_3 == nullptr) { continue; } factoryV1_3->getSupportedCryptoSchemes( [&](const hardware::hidl_vec<hardware::hidl_array<uint8_t, 16>>& schemes) { for (const auto &scheme : schemes) { bv.insert(bv.end(), scheme.data(), scheme.data() + scheme.size()); } }); } drm->getSupportedSchemes(bv); jbyteArray jUuidBytes = env->NewByteArray(bv.size()); env->SetByteArrayRegion(jUuidBytes, 0, bv.size(), reinterpret_cast<const jbyte *>(bv.data())); Loading