Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -12524,6 +12524,7 @@ package android.media { method public android.media.MediaDrm.ProvisionRequest getProvisionRequest(); method public java.util.List<byte[]> getSecureStops(); method public static final boolean isCryptoSchemeSupported(java.util.UUID); method public static final boolean isCryptoSchemeSupported(java.util.UUID, java.lang.String); method public byte[] openSession() throws android.media.NotProvisionedException; method public byte[] provideKeyResponse(byte[], byte[]) throws android.media.DeniedByServerException, android.media.NotProvisionedException; method public void provideProvisionResponse(byte[]) throws android.media.DeniedByServerException; media/java/android/media/MediaDrm.java +15 −2 Original line number Diff line number Diff line Loading @@ -108,7 +108,19 @@ public final class MediaDrm { * @param uuid The UUID of the crypto scheme. */ public static final boolean isCryptoSchemeSupported(UUID uuid) { return isCryptoSchemeSupportedNative(getByteArrayFromUUID(uuid)); return isCryptoSchemeSupportedNative(getByteArrayFromUUID(uuid), null); } /** * Query if the given scheme identified by its UUID is supported on * this device, and whether the drm plugin is able to handle the * media container format specified by mimeType. * @param uuid The UUID of the crypto scheme. * @param mimeType The MIME type of the media container, e.g. "video/mp4" * or "video/webm" */ public static final boolean isCryptoSchemeSupported(UUID uuid, String mimeType) { return isCryptoSchemeSupportedNative(getByteArrayFromUUID(uuid), mimeType); } private static final byte[] getByteArrayFromUUID(UUID uuid) { Loading @@ -124,7 +136,8 @@ public final class MediaDrm { return uuidBytes; } private static final native boolean isCryptoSchemeSupportedNative(byte[] uuid); private static final native boolean isCryptoSchemeSupportedNative(byte[] uuid, String mimeType); /** * Instantiate a MediaDrm object Loading media/jni/android_media_MediaDrm.cpp +10 −5 Original line number Diff line number Diff line Loading @@ -348,14 +348,14 @@ void JDrm::notify(DrmPlugin::EventType eventType, int extra, const Parcel *obj) // static bool JDrm::IsCryptoSchemeSupported(const uint8_t uuid[16]) { bool JDrm::IsCryptoSchemeSupported(const uint8_t uuid[16], const String8 &mimeType) { sp<IDrm> drm = MakeDrm(); if (drm == NULL) { return false; } return drm->isCryptoSchemeSupported(uuid); return drm->isCryptoSchemeSupported(uuid, mimeType); } status_t JDrm::initCheck() const { Loading Loading @@ -611,7 +611,7 @@ static void android_media_MediaDrm_native_finalize( } static jboolean android_media_MediaDrm_isCryptoSchemeSupportedNative( JNIEnv *env, jobject thiz, jbyteArray uuidObj) { JNIEnv *env, jobject thiz, jbyteArray uuidObj, jstring jmimeType) { if (uuidObj == NULL) { jniThrowException(env, "java/lang/IllegalArgumentException", NULL); Loading @@ -628,7 +628,12 @@ static jboolean android_media_MediaDrm_isCryptoSchemeSupportedNative( return false; } return JDrm::IsCryptoSchemeSupported(uuid.array()); String8 mimeType; if (jmimeType != NULL) { mimeType = JStringToString8(env, jmimeType); } return JDrm::IsCryptoSchemeSupported(uuid.array(), mimeType); } static jbyteArray android_media_MediaDrm_openSession( Loading Loading @@ -1212,7 +1217,7 @@ static JNINativeMethod gMethods[] = { { "native_finalize", "()V", (void *)android_media_MediaDrm_native_finalize }, { "isCryptoSchemeSupportedNative", "([B)Z", { "isCryptoSchemeSupportedNative", "([BLjava/lang/String;)Z", (void *)android_media_MediaDrm_isCryptoSchemeSupportedNative }, { "openSession", "()[B", Loading media/jni/android_media_MediaDrm.h +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public: }; struct JDrm : public BnDrmClient { static bool IsCryptoSchemeSupported(const uint8_t uuid[16]); static bool IsCryptoSchemeSupported(const uint8_t uuid[16], const String8 &mimeType); JDrm(JNIEnv *env, jobject thiz, const uint8_t uuid[16]); Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -12524,6 +12524,7 @@ package android.media { method public android.media.MediaDrm.ProvisionRequest getProvisionRequest(); method public java.util.List<byte[]> getSecureStops(); method public static final boolean isCryptoSchemeSupported(java.util.UUID); method public static final boolean isCryptoSchemeSupported(java.util.UUID, java.lang.String); method public byte[] openSession() throws android.media.NotProvisionedException; method public byte[] provideKeyResponse(byte[], byte[]) throws android.media.DeniedByServerException, android.media.NotProvisionedException; method public void provideProvisionResponse(byte[]) throws android.media.DeniedByServerException;
media/java/android/media/MediaDrm.java +15 −2 Original line number Diff line number Diff line Loading @@ -108,7 +108,19 @@ public final class MediaDrm { * @param uuid The UUID of the crypto scheme. */ public static final boolean isCryptoSchemeSupported(UUID uuid) { return isCryptoSchemeSupportedNative(getByteArrayFromUUID(uuid)); return isCryptoSchemeSupportedNative(getByteArrayFromUUID(uuid), null); } /** * Query if the given scheme identified by its UUID is supported on * this device, and whether the drm plugin is able to handle the * media container format specified by mimeType. * @param uuid The UUID of the crypto scheme. * @param mimeType The MIME type of the media container, e.g. "video/mp4" * or "video/webm" */ public static final boolean isCryptoSchemeSupported(UUID uuid, String mimeType) { return isCryptoSchemeSupportedNative(getByteArrayFromUUID(uuid), mimeType); } private static final byte[] getByteArrayFromUUID(UUID uuid) { Loading @@ -124,7 +136,8 @@ public final class MediaDrm { return uuidBytes; } private static final native boolean isCryptoSchemeSupportedNative(byte[] uuid); private static final native boolean isCryptoSchemeSupportedNative(byte[] uuid, String mimeType); /** * Instantiate a MediaDrm object Loading
media/jni/android_media_MediaDrm.cpp +10 −5 Original line number Diff line number Diff line Loading @@ -348,14 +348,14 @@ void JDrm::notify(DrmPlugin::EventType eventType, int extra, const Parcel *obj) // static bool JDrm::IsCryptoSchemeSupported(const uint8_t uuid[16]) { bool JDrm::IsCryptoSchemeSupported(const uint8_t uuid[16], const String8 &mimeType) { sp<IDrm> drm = MakeDrm(); if (drm == NULL) { return false; } return drm->isCryptoSchemeSupported(uuid); return drm->isCryptoSchemeSupported(uuid, mimeType); } status_t JDrm::initCheck() const { Loading Loading @@ -611,7 +611,7 @@ static void android_media_MediaDrm_native_finalize( } static jboolean android_media_MediaDrm_isCryptoSchemeSupportedNative( JNIEnv *env, jobject thiz, jbyteArray uuidObj) { JNIEnv *env, jobject thiz, jbyteArray uuidObj, jstring jmimeType) { if (uuidObj == NULL) { jniThrowException(env, "java/lang/IllegalArgumentException", NULL); Loading @@ -628,7 +628,12 @@ static jboolean android_media_MediaDrm_isCryptoSchemeSupportedNative( return false; } return JDrm::IsCryptoSchemeSupported(uuid.array()); String8 mimeType; if (jmimeType != NULL) { mimeType = JStringToString8(env, jmimeType); } return JDrm::IsCryptoSchemeSupported(uuid.array(), mimeType); } static jbyteArray android_media_MediaDrm_openSession( Loading Loading @@ -1212,7 +1217,7 @@ static JNINativeMethod gMethods[] = { { "native_finalize", "()V", (void *)android_media_MediaDrm_native_finalize }, { "isCryptoSchemeSupportedNative", "([B)Z", { "isCryptoSchemeSupportedNative", "([BLjava/lang/String;)Z", (void *)android_media_MediaDrm_isCryptoSchemeSupportedNative }, { "openSession", "()[B", Loading
media/jni/android_media_MediaDrm.h +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public: }; struct JDrm : public BnDrmClient { static bool IsCryptoSchemeSupported(const uint8_t uuid[16]); static bool IsCryptoSchemeSupported(const uint8_t uuid[16], const String8 &mimeType); JDrm(JNIEnv *env, jobject thiz, const uint8_t uuid[16]); Loading