From 530deca4be5a7ca0ca911cb8da0b653e25e99910 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Fri, 6 Dec 2019 14:44:18 -0700 Subject: More robust DRM support, including tests. Based on guidance from the DRM team, we should pass DRM files directly to MediaMetadataRetriever, which can be used to obtain both the underlying MIME type and the typical metadata to be indexed. To help ensure this works correctly and doesn't regress, borrow strategy from CTS which creates new Forward Locked media items for testing, and verify that we scan them correctly. Allow MediaMetadataRetriever to override the MIME type obtained from a file extension, but only when the primary type agrees with the extension. This is the same policy we apply to XMP metadata. Bug: 141146658 Test: atest --test-mapping packages/providers/MediaProvider Change-Id: I494a539a81ed39411a3b59c4433b6520967962c2 --- drm/java/android/drm/DrmManagerClient.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'drm') diff --git a/drm/java/android/drm/DrmManagerClient.java b/drm/java/android/drm/DrmManagerClient.java index fcebad339f2b..041300c4b1b0 100644 --- a/drm/java/android/drm/DrmManagerClient.java +++ b/drm/java/android/drm/DrmManagerClient.java @@ -16,6 +16,7 @@ package android.drm; +import android.annotation.NonNull; import android.content.ContentResolver; import android.content.ContentValues; import android.content.Context; @@ -37,6 +38,8 @@ import java.io.FileInputStream; import java.io.IOException; import java.lang.ref.WeakReference; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; import java.util.HashMap; import java.util.concurrent.atomic.AtomicBoolean; @@ -369,6 +372,17 @@ public class DrmManagerClient implements AutoCloseable { return descriptions.toArray(drmEngines); } + /** + * Retrieves information about all the DRM plug-ins (agents) that are + * registered with the DRM framework. + * + * @return List of all the DRM plug-ins (agents) that are registered with + * the DRM framework. + */ + public @NonNull Collection getAvailableDrmSupportInfo() { + return Arrays.asList(_getAllSupportInfo(mUniqueId)); + } + /** * Retrieves constraint information for rights-protected content. * -- cgit v1.2.3