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

Commit 643ba186 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Resolve feedback from API review: MediaDrm"

parents 4bb646d2 f11261ba
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24925,6 +24925,7 @@ package android.media {
    ctor public MediaDrm.SessionException(int, @Nullable String);
    method public int getErrorCode();
    field public static final int ERROR_RESOURCE_CONTENTION = 1; // 0x1
    field public static final int ERROR_UNKNOWN = 0; // 0x0
  }
  public class MediaDrmException extends java.lang.Exception {
+5 −0
Original line number Diff line number Diff line
@@ -303,6 +303,11 @@ public final class MediaDrm implements AutoCloseable {
            mErrorCode = errorCode;
        }

        /**
         * The SessionException has an unknown error code.
         */
        public static final int ERROR_UNKNOWN = 0;

        /**
         * This indicates that apps using MediaDrm sessions are
         * temporarily exceeding the capacity of available crypto
+3 −0
Original line number Diff line number Diff line
@@ -149,6 +149,7 @@ struct SessionExceptionFields {
};

struct SessionExceptionErrorCodes {
    jint kErrorUnknown;
    jint kResourceContention;
} gSessionExceptionErrorCodes;

@@ -888,6 +889,8 @@ static void android_media_MediaDrm_native_init(JNIEnv *env) {
    gFields.sessionException.classId = static_cast<jclass>(env->NewGlobalRef(clazz));
    GET_FIELD_ID(gFields.sessionException.errorCode, clazz, "mErrorCode", "I");

    GET_STATIC_FIELD_ID(field, clazz, "ERROR_UNKNOWN", "I");
    gSessionExceptionErrorCodes.kErrorUnknown = env->GetStaticIntField(clazz, field);
    GET_STATIC_FIELD_ID(field, clazz, "ERROR_RESOURCE_CONTENTION", "I");
    gSessionExceptionErrorCodes.kResourceContention = env->GetStaticIntField(clazz, field);
}