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

Commit 56cd7db1 authored by Robert Shih's avatar Robert Shih Committed by Android (Google) Code Review
Browse files

Merge "MediaDrm: revamp error codes & their javadocs" into sc-dev

parents 55356d91 dcef44ef
Loading
Loading
Loading
Loading
+51 −12
Original line number Diff line number Diff line
@@ -21118,15 +21118,15 @@ package android.media {
  public static final class MediaCodec.CryptoException extends java.lang.RuntimeException {
    ctor public MediaCodec.CryptoException(int, @Nullable String);
    method public int getErrorCode();
    field public static final int ERROR_FRAME_TOO_LARGE = 8; // 0x8
    field public static final int ERROR_INSUFFICIENT_OUTPUT_PROTECTION = 4; // 0x4
    field public static final int ERROR_INSUFFICIENT_SECURITY = 7; // 0x7
    field public static final int ERROR_KEY_EXPIRED = 2; // 0x2
    field public static final int ERROR_LOST_STATE = 9; // 0x9
    field public static final int ERROR_NO_KEY = 1; // 0x1
    field public static final int ERROR_RESOURCE_BUSY = 3; // 0x3
    field public static final int ERROR_SESSION_NOT_OPENED = 5; // 0x5
    field public static final int ERROR_UNSUPPORTED_OPERATION = 6; // 0x6
    field @Deprecated public static final int ERROR_FRAME_TOO_LARGE = 8; // 0x8
    field @Deprecated public static final int ERROR_INSUFFICIENT_OUTPUT_PROTECTION = 4; // 0x4
    field @Deprecated public static final int ERROR_INSUFFICIENT_SECURITY = 7; // 0x7
    field @Deprecated public static final int ERROR_KEY_EXPIRED = 2; // 0x2
    field @Deprecated public static final int ERROR_LOST_STATE = 9; // 0x9
    field @Deprecated public static final int ERROR_NO_KEY = 1; // 0x1
    field @Deprecated public static final int ERROR_RESOURCE_BUSY = 3; // 0x3
    field @Deprecated public static final int ERROR_SESSION_NOT_OPENED = 5; // 0x5
    field @Deprecated public static final int ERROR_UNSUPPORTED_OPERATION = 6; // 0x6
  }
  public static final class MediaCodec.CryptoInfo {
@@ -21745,6 +21745,42 @@ package android.media {
    method public boolean verify(@NonNull byte[], @NonNull byte[], @NonNull byte[]);
  }
  public static final class MediaDrm.ErrorCodes {
    field public static final int ERROR_CERTIFICATE_MALFORMED = 10; // 0xa
    field public static final int ERROR_CERTIFICATE_MISSING = 11; // 0xb
    field public static final int ERROR_CRYPTO_LIBRARY = 12; // 0xc
    field public static final int ERROR_FRAME_TOO_LARGE = 8; // 0x8
    field public static final int ERROR_GENERIC_OEM = 13; // 0xd
    field public static final int ERROR_GENERIC_PLUGIN = 14; // 0xe
    field public static final int ERROR_INIT_DATA = 15; // 0xf
    field public static final int ERROR_INSUFFICIENT_OUTPUT_PROTECTION = 4; // 0x4
    field public static final int ERROR_INSUFFICIENT_SECURITY = 7; // 0x7
    field public static final int ERROR_KEY_EXPIRED = 2; // 0x2
    field public static final int ERROR_KEY_NOT_LOADED = 16; // 0x10
    field public static final int ERROR_LICENSE_PARSE = 17; // 0x11
    field public static final int ERROR_LICENSE_POLICY = 18; // 0x12
    field public static final int ERROR_LICENSE_RELEASE = 19; // 0x13
    field public static final int ERROR_LICENSE_REQUEST_REJECTED = 20; // 0x14
    field public static final int ERROR_LICENSE_RESTORE = 21; // 0x15
    field public static final int ERROR_LICENSE_STATE = 22; // 0x16
    field public static final int ERROR_LOST_STATE = 9; // 0x9
    field public static final int ERROR_MEDIA_FRAMEWORK = 23; // 0x17
    field public static final int ERROR_NO_KEY = 1; // 0x1
    field public static final int ERROR_PROVISIONING_CERTIFICATE = 24; // 0x18
    field public static final int ERROR_PROVISIONING_CONFIG = 25; // 0x19
    field public static final int ERROR_PROVISIONING_PARSE = 26; // 0x1a
    field public static final int ERROR_PROVISIONING_RETRY = 27; // 0x1b
    field public static final int ERROR_RESOURCE_BUSY = 3; // 0x3
    field public static final int ERROR_RESOURCE_CONTENTION = 28; // 0x1c
    field public static final int ERROR_SECURE_STOP_RELEASE = 29; // 0x1d
    field public static final int ERROR_SESSION_NOT_OPENED = 5; // 0x5
    field public static final int ERROR_STORAGE_READ = 30; // 0x1e
    field public static final int ERROR_STORAGE_WRITE = 31; // 0x1f
    field public static final int ERROR_UNKNOWN = 0; // 0x0
    field public static final int ERROR_UNSUPPORTED_OPERATION = 6; // 0x6
    field public static final int ERROR_ZERO_SUBSAMPLES = 32; // 0x20
  }
  @Deprecated @IntDef({android.media.MediaDrm.HDCP_LEVEL_UNKNOWN, android.media.MediaDrm.HDCP_NONE, android.media.MediaDrm.HDCP_V1, android.media.MediaDrm.HDCP_V2, android.media.MediaDrm.HDCP_V2_1, android.media.MediaDrm.HDCP_V2_2, android.media.MediaDrm.HDCP_V2_3, android.media.MediaDrm.HDCP_NO_DIGITAL_OUTPUT}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface MediaDrm.HdcpLevel {
  }
@@ -21778,6 +21814,8 @@ package android.media {
  public static final class MediaDrm.MediaDrmStateException extends java.lang.IllegalStateException {
    method @NonNull public String getDiagnosticInfo();
    method public int getErrorCode();
    method public boolean isTransient();
  }
  public static final class MediaDrm.MetricsConstants {
@@ -21844,9 +21882,10 @@ package android.media {
  public static final class MediaDrm.SessionException extends java.lang.RuntimeException {
    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
    method @Deprecated public int getErrorCode();
    method public boolean isTransient();
    field @Deprecated public static final int ERROR_RESOURCE_CONTENTION = 1; // 0x1
    field @Deprecated public static final int ERROR_UNKNOWN = 0; // 0x0
  }
  public class MediaDrmException extends java.lang.Exception {
+42 −19
Original line number Diff line number Diff line
@@ -2414,37 +2414,44 @@ final public class MediaCodec implements PlaybackComponent {
         * This indicates that the requested key was not found when trying to
         * perform a decrypt operation.  The operation can be retried after adding
         * the correct decryption key.
         * @deprecated Please use {@link MediaDrm.ErrorCodes#ERROR_NO_KEY}.
         */
        public static final int ERROR_NO_KEY = 1;
        public static final int ERROR_NO_KEY = MediaDrm.ErrorCodes.ERROR_NO_KEY;

        /**
         * This indicates that the key used for decryption is no longer
         * valid due to license term expiration.  The operation can be retried
         * after updating the expired keys.
         * @deprecated Please use {@link MediaDrm.ErrorCodes#ERROR_KEY_EXPIRED}.
         */
        public static final int ERROR_KEY_EXPIRED = 2;
        public static final int ERROR_KEY_EXPIRED = MediaDrm.ErrorCodes.ERROR_KEY_EXPIRED;

        /**
         * This indicates that a required crypto resource was not able to be
         * allocated while attempting the requested operation.  The operation
         * can be retried if the app is able to release resources.
         * @deprecated Please use {@link MediaDrm.ErrorCodes#ERROR_RESOURCE_BUSY}
         */
        public static final int ERROR_RESOURCE_BUSY = 3;
        public static final int ERROR_RESOURCE_BUSY = MediaDrm.ErrorCodes.ERROR_RESOURCE_BUSY;

        /**
         * This indicates that the output protection levels supported by the
         * device are not sufficient to meet the requirements set by the
         * content owner in the license policy.
         * @deprecated Please use {@link MediaDrm.ErrorCodes#ERROR_INSUFFICIENT_OUTPUT_PROTECTION}
         */
        public static final int ERROR_INSUFFICIENT_OUTPUT_PROTECTION = 4;
        public static final int ERROR_INSUFFICIENT_OUTPUT_PROTECTION =
                MediaDrm.ErrorCodes.ERROR_INSUFFICIENT_OUTPUT_PROTECTION;

        /**
         * This indicates that decryption was attempted on a session that is
         * not opened, which could be due to a failure to open the session,
         * closing the session prematurely, or the session being reclaimed
         * by the resource manager.
         * @deprecated Please use {@link MediaDrm.ErrorCodes#ERROR_SESSION_NOT_OPENED}
         */
        public static final int ERROR_SESSION_NOT_OPENED = 5;
        public static final int ERROR_SESSION_NOT_OPENED =
                MediaDrm.ErrorCodes.ERROR_SESSION_NOT_OPENED;

        /**
         * This indicates that an operation was attempted that could not be
@@ -2453,23 +2460,28 @@ final public class MediaCodec implements PlaybackComponent {
         * device security features that aren't supported by the device,
         * or due to an internal error in the crypto system that prevents
         * the specified security policy from being met.
         * @deprecated Please use {@link MediaDrm.ErrorCodes#ERROR_UNSUPPORTED_OPERATION}
         */
        public static final int ERROR_UNSUPPORTED_OPERATION = 6;
        public static final int ERROR_UNSUPPORTED_OPERATION =
                MediaDrm.ErrorCodes.ERROR_UNSUPPORTED_OPERATION;

        /**
         * This indicates that the security level of the device is not
         * sufficient to meet the requirements set by the content owner
         * in the license policy.
         * @deprecated Please use {@link MediaDrm.ErrorCodes#ERROR_INSUFFICIENT_SECURITY}
         */
        public static final int ERROR_INSUFFICIENT_SECURITY = 7;
        public static final int ERROR_INSUFFICIENT_SECURITY =
                MediaDrm.ErrorCodes.ERROR_INSUFFICIENT_SECURITY;

        /**
         * This indicates that the video frame being decrypted exceeds
         * the size of the device's protected output buffers. When
         * encountering this error the app should try playing content
         * of a lower resolution.
         * @deprecated Please use {@link MediaDrm.ErrorCodes#ERROR_FRAME_TOO_LARGE}
         */
        public static final int ERROR_FRAME_TOO_LARGE = 8;
        public static final int ERROR_FRAME_TOO_LARGE = MediaDrm.ErrorCodes.ERROR_FRAME_TOO_LARGE;

        /**
         * This error indicates that session state has been
@@ -2477,26 +2489,37 @@ final public class MediaCodec implements PlaybackComponent {
         * of retaining crypto session state across device
         * suspend/resume. The session must be closed and a new
         * session opened to resume operation.
         * @deprecated Please use {@link MediaDrm.ErrorCodes#ERROR_LOST_STATE}
         */
        public static final int ERROR_LOST_STATE = 9;
        public static final int ERROR_LOST_STATE = MediaDrm.ErrorCodes.ERROR_LOST_STATE;

        /** @hide */
        @IntDef({
            ERROR_NO_KEY,
            ERROR_KEY_EXPIRED,
            ERROR_RESOURCE_BUSY,
            ERROR_INSUFFICIENT_OUTPUT_PROTECTION,
            ERROR_SESSION_NOT_OPENED,
            ERROR_UNSUPPORTED_OPERATION,
            ERROR_INSUFFICIENT_SECURITY,
            ERROR_FRAME_TOO_LARGE,
            ERROR_LOST_STATE
            MediaDrm.ErrorCodes.ERROR_NO_KEY,
            MediaDrm.ErrorCodes.ERROR_KEY_EXPIRED,
            MediaDrm.ErrorCodes.ERROR_RESOURCE_BUSY,
            MediaDrm.ErrorCodes.ERROR_INSUFFICIENT_OUTPUT_PROTECTION,
            MediaDrm.ErrorCodes.ERROR_SESSION_NOT_OPENED,
            MediaDrm.ErrorCodes.ERROR_UNSUPPORTED_OPERATION,
            MediaDrm.ErrorCodes.ERROR_INSUFFICIENT_SECURITY,
            MediaDrm.ErrorCodes.ERROR_FRAME_TOO_LARGE,
            MediaDrm.ErrorCodes.ERROR_LOST_STATE,
            MediaDrm.ErrorCodes.ERROR_GENERIC_OEM,
            MediaDrm.ErrorCodes.ERROR_GENERIC_PLUGIN,
            MediaDrm.ErrorCodes.ERROR_LICENSE_PARSE,
            MediaDrm.ErrorCodes.ERROR_MEDIA_FRAMEWORK,
            MediaDrm.ErrorCodes.ERROR_ZERO_SUBSAMPLES
        })
        @Retention(RetentionPolicy.SOURCE)
        public @interface CryptoErrorCode {}

        /**
         * Retrieve the error code associated with a CryptoException
         * Returns error code associated with this {@link CryptoException}.
         * <p>
         * Please refer to {@link MediaDrm.ErrorCodes} for the general error
         * handling strategy and details about each possible return value.
         *
         * @return an error code defined in {@link MediaDrm.ErrorCodes}.
         */
        @CryptoErrorCode
        public int getErrorCode() {
+399 −5

File changed.

Preview size limit exceeded, changes collapsed.