diff options
author | Lajos Molnar <lajos@google.com> | 2014-09-10 02:38:49 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-10 02:38:50 +0000 |
commit | 2c5afa320e617556351ff058f9ef94f7cdbd24cb (patch) | |
tree | dc0c9b10ef3117a3f7a0bb59c5063fae78b08dd5 /media | |
parent | 8c4d53c3a9299b0c1fce2bf1c363ea199ad9ac16 (diff) | |
parent | d7e5f680fa64b76c3d1c2a67572896705a0588ed (diff) | |
download | frameworks_base-2c5afa320e617556351ff058f9ef94f7cdbd24cb.zip frameworks_base-2c5afa320e617556351ff058f9ef94f7cdbd24cb.tar.gz frameworks_base-2c5afa320e617556351ff058f9ef94f7cdbd24cb.tar.bz2 |
Merge "MediaCodec/Drm: move from getErrorCode to getDiagnosticInfo" into lmp-dev
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/MediaCodec.java | 18 | ||||
-rw-r--r-- | media/java/android/media/MediaDrm.java | 19 |
2 files changed, 37 insertions, 0 deletions
diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java index 81ebb14..1c7c9ea 100644 --- a/media/java/android/media/MediaCodec.java +++ b/media/java/android/media/MediaCodec.java @@ -672,6 +672,11 @@ final public class MediaCodec { super(detailMessage); mErrorCode = errorCode; mActionCode = actionCode; + + // TODO get this from codec + final String sign = errorCode < 0 ? "neg_" : ""; + mDiagnosticInfo = + "android.media.MediaCodec.error_" + sign + Math.abs(errorCode); } /** @@ -696,15 +701,28 @@ final public class MediaCodec { * Retrieve the error code associated with a CodecException. * This is opaque diagnostic information and may depend on * hardware or API level. + * + * @hide */ public int getErrorCode() { return mErrorCode; } + /** + * Retrieve a human readable diagnostic information string + * associated with the exception. DO NOT SHOW THIS TO END-USERS! + * This string will not be localized or generally comprehensible + * to end-users. + */ + public String getDiagnosticInfo() { + return mDiagnosticInfo; + } + /* Must be in sync with android_media_MediaCodec.cpp */ private final static int ACTION_TRANSIENT = 1; private final static int ACTION_RECOVERABLE = 2; + private final String mDiagnosticInfo; private final int mErrorCode; private final int mActionCode; } diff --git a/media/java/android/media/MediaDrm.java b/media/java/android/media/MediaDrm.java index ca707d8..1490732 100644 --- a/media/java/android/media/MediaDrm.java +++ b/media/java/android/media/MediaDrm.java @@ -188,18 +188,37 @@ public final class MediaDrm { */ public static final class MediaDrmStateException extends java.lang.IllegalStateException { private final int mErrorCode; + private final String mDiagnosticInfo; public MediaDrmStateException(int errorCode, String detailMessage) { super(detailMessage); mErrorCode = errorCode; + + // TODO get this from DRM session + final String sign = errorCode < 0 ? "neg_" : ""; + mDiagnosticInfo = + "android.media.MediaDrm.error_" + sign + Math.abs(errorCode); + } /** * Retrieve the associated error code + * + * @hide */ public int getErrorCode() { return mErrorCode; } + + /** + * Retrieve a human readable diagnostic information string + * associated with the exception. DO NOT SHOW THIS TO END-USERS! + * This string will not be localized or generally comprehensible + * to end-users. + */ + public String getDiagnosticInfo() { + return mDiagnosticInfo; + } } /** |