Merge "Change getSupportedCryptoSchemesNative to use getSupportedSchemes" into tm-dev
This commit is contained in:
@@ -1003,19 +1003,9 @@ DrmPlugin::SecurityLevel jintToSecurityLevel(jint jlevel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jbyteArray android_media_MediaDrm_getSupportedCryptoSchemesNative(JNIEnv *env) {
|
static jbyteArray android_media_MediaDrm_getSupportedCryptoSchemesNative(JNIEnv *env) {
|
||||||
|
sp<IDrm> drm = android::DrmUtils::MakeDrm();
|
||||||
std::vector<uint8_t> bv;
|
std::vector<uint8_t> bv;
|
||||||
for (auto &factory : DrmUtils::MakeDrmFactories()) {
|
drm->getSupportedSchemes(bv);
|
||||||
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());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
jbyteArray jUuidBytes = env->NewByteArray(bv.size());
|
jbyteArray jUuidBytes = env->NewByteArray(bv.size());
|
||||||
env->SetByteArrayRegion(jUuidBytes, 0, bv.size(), reinterpret_cast<const jbyte *>(bv.data()));
|
env->SetByteArrayRegion(jUuidBytes, 0, bv.size(), reinterpret_cast<const jbyte *>(bv.data()));
|
||||||
|
|||||||
Reference in New Issue
Block a user