summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dongwon Kang <dwkang@google.com> 2018-11-27 13:53:19 -0800
committer Dongwon Kang <dwkang@google.com> 2018-11-27 16:58:06 -0800
commit4c7fc507959511ac5f6ea628d9963f953e01a2dc (patch)
treec0087fc570e15679360a44e18a6a346d3d6a6db8
parentdfd0ca889f9ea3b1da58fb5eb009e782237f414d (diff)
MediaPlayer2: replace external constant annonations with local ones
Test: build Bug: 112766913 Change-Id: I94f110caed01b5aa8ec56bff2d9da8a7d5dcc4b9
-rw-r--r--media/java/android/media/MediaPlayer2.java26
1 files changed, 23 insertions, 3 deletions
diff --git a/media/java/android/media/MediaPlayer2.java b/media/java/android/media/MediaPlayer2.java
index 7e9a408b50b7..267dab9c46a1 100644
--- a/media/java/android/media/MediaPlayer2.java
+++ b/media/java/android/media/MediaPlayer2.java
@@ -20,6 +20,7 @@ import android.annotation.CallbackExecutor;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.StringDef;
import android.annotation.UnsupportedAppUsage;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningAppProcessInfo;
@@ -3315,6 +3316,25 @@ public class MediaPlayer2 implements AutoCloseable
@Retention(RetentionPolicy.SOURCE)
public @interface PrepareDrmStatusCode {}
+ /** @hide */
+ @IntDef({
+ MediaDrm.KEY_TYPE_STREAMING,
+ MediaDrm.KEY_TYPE_OFFLINE,
+ MediaDrm.KEY_TYPE_RELEASE,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface MediaDrmKeyType {}
+
+ /** @hide */
+ @StringDef({
+ MediaDrm.PROPERTY_VENDOR,
+ MediaDrm.PROPERTY_VERSION,
+ MediaDrm.PROPERTY_DESCRIPTION,
+ MediaDrm.PROPERTY_ALGORITHMS,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface MediaDrmStringProperty {}
+
/**
* Retrieves the DRM Info associated with the given source
*
@@ -3622,7 +3642,7 @@ public class MediaPlayer2 implements AutoCloseable
public MediaDrm.KeyRequest getDrmKeyRequest(
@NonNull DataSourceDesc dsd,
@Nullable byte[] keySetId, @Nullable byte[] initData,
- @Nullable String mimeType, @MediaDrm.KeyType int keyType,
+ @Nullable String mimeType, @MediaDrmKeyType int keyType,
@Nullable Map<String, String> optionalParameters)
throws NoDrmSchemeException {
// TODO: this implementation only works when dsd is the only data source
@@ -3780,7 +3800,7 @@ public class MediaPlayer2 implements AutoCloseable
@NonNull
public String getDrmPropertyString(
@NonNull DataSourceDesc dsd,
- @NonNull @MediaDrm.StringProperty String propertyName)
+ @NonNull @MediaDrmStringProperty String propertyName)
throws NoDrmSchemeException {
// TODO: this implementation only works when dsd is the only data source
Log.v(TAG, "getDrmPropertyString: propertyName: " + propertyName);
@@ -3823,7 +3843,7 @@ public class MediaPlayer2 implements AutoCloseable
// This is a synchronous call.
public void setDrmPropertyString(
@NonNull DataSourceDesc dsd,
- @NonNull @MediaDrm.StringProperty String propertyName, @NonNull String value)
+ @NonNull @MediaDrmStringProperty String propertyName, @NonNull String value)
throws NoDrmSchemeException {
// TODO: this implementation only works when dsd is the only data source
Log.v(TAG, "setDrmPropertyString: propertyName: " + propertyName + " value: " + value);