Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c7fc507 authored by Dongwon Kang's avatar Dongwon Kang
Browse files

MediaPlayer2: replace external constant annonations with local ones

Test: build
Bug: 112766913
Change-Id: I94f110caed01b5aa8ec56bff2d9da8a7d5dcc4b9
parent dfd0ca88
Loading
Loading
Loading
Loading
+23 −3
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@ import android.annotation.CallbackExecutor;
import android.annotation.IntDef;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Nullable;
import android.annotation.StringDef;
import android.annotation.UnsupportedAppUsage;
import android.annotation.UnsupportedAppUsage;
import android.app.ActivityManager;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningAppProcessInfo;
import android.app.ActivityManager.RunningAppProcessInfo;
@@ -3315,6 +3316,25 @@ public class MediaPlayer2 implements AutoCloseable
    @Retention(RetentionPolicy.SOURCE)
    @Retention(RetentionPolicy.SOURCE)
    public @interface PrepareDrmStatusCode {}
    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
     * Retrieves the DRM Info associated with the given source
     *
     *
@@ -3622,7 +3642,7 @@ public class MediaPlayer2 implements AutoCloseable
    public MediaDrm.KeyRequest getDrmKeyRequest(
    public MediaDrm.KeyRequest getDrmKeyRequest(
            @NonNull DataSourceDesc dsd,
            @NonNull DataSourceDesc dsd,
            @Nullable byte[] keySetId, @Nullable byte[] initData,
            @Nullable byte[] keySetId, @Nullable byte[] initData,
            @Nullable String mimeType, @MediaDrm.KeyType int keyType,
            @Nullable String mimeType, @MediaDrmKeyType int keyType,
            @Nullable Map<String, String> optionalParameters)
            @Nullable Map<String, String> optionalParameters)
            throws NoDrmSchemeException {
            throws NoDrmSchemeException {
        // TODO: this implementation only works when dsd is the only data source
        // TODO: this implementation only works when dsd is the only data source
@@ -3780,7 +3800,7 @@ public class MediaPlayer2 implements AutoCloseable
    @NonNull
    @NonNull
    public String getDrmPropertyString(
    public String getDrmPropertyString(
            @NonNull DataSourceDesc dsd,
            @NonNull DataSourceDesc dsd,
            @NonNull @MediaDrm.StringProperty String propertyName)
            @NonNull @MediaDrmStringProperty String propertyName)
            throws NoDrmSchemeException {
            throws NoDrmSchemeException {
        // TODO: this implementation only works when dsd is the only data source
        // TODO: this implementation only works when dsd is the only data source
        Log.v(TAG, "getDrmPropertyString: propertyName: " + propertyName);
        Log.v(TAG, "getDrmPropertyString: propertyName: " + propertyName);
@@ -3823,7 +3843,7 @@ public class MediaPlayer2 implements AutoCloseable
    // This is a synchronous call.
    // This is a synchronous call.
    public void setDrmPropertyString(
    public void setDrmPropertyString(
            @NonNull DataSourceDesc dsd,
            @NonNull DataSourceDesc dsd,
            @NonNull @MediaDrm.StringProperty String propertyName, @NonNull String value)
            @NonNull @MediaDrmStringProperty String propertyName, @NonNull String value)
            throws NoDrmSchemeException {
            throws NoDrmSchemeException {
        // TODO: this implementation only works when dsd is the only data source
        // TODO: this implementation only works when dsd is the only data source
        Log.v(TAG, "setDrmPropertyString: propertyName: " + propertyName + " value: " + value);
        Log.v(TAG, "setDrmPropertyString: propertyName: " + propertyName + " value: " + value);