diff options
author | Jeff Sharkey <jsharkey@android.com> | 2019-12-06 14:44:18 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2019-12-06 14:44:21 -0700 |
commit | 530deca4be5a7ca0ca911cb8da0b653e25e99910 (patch) | |
tree | 4001fd341bfbc76db711be0dd9066fe0a9ea6f63 /drm | |
parent | 1403ee3ad54833761da7ea5f72ffef70fa340c88 (diff) |
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
Diffstat (limited to 'drm')
-rw-r--r-- | drm/java/android/drm/DrmManagerClient.java | 14 |
1 files changed, 14 insertions, 0 deletions
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; @@ -370,6 +373,17 @@ public class DrmManagerClient implements AutoCloseable { } /** + * 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<DrmSupportInfo> getAvailableDrmSupportInfo() { + return Arrays.asList(_getAllSupportInfo(mUniqueId)); + } + + /** * Retrieves constraint information for rights-protected content. * * @param path Path to the content from which you are retrieving DRM constraints. |