summaryrefslogtreecommitdiffstats
path: root/media/jni
diff options
context:
space:
mode:
authorJeff Tinker <jtinker@google.com>2013-05-01 15:04:36 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-05-01 15:04:36 -0700
commite0eb0e90630c19808429a9bcdc9ff8dff085d2e8 (patch)
tree76640af3c99b18be37d7b90daca1e4f8add3cba2 /media/jni
parentc3bc1b671e3a4feb4f6d2693199f15e42c256fd4 (diff)
parent9ba564c7e205c4b278be61eec773a90a94451251 (diff)
downloadframeworks_base-e0eb0e90630c19808429a9bcdc9ff8dff085d2e8.zip
frameworks_base-e0eb0e90630c19808429a9bcdc9ff8dff085d2e8.tar.gz
frameworks_base-e0eb0e90630c19808429a9bcdc9ff8dff085d2e8.tar.bz2
am 9ba564c7: am 48f2b548: Merge "MediaDrm API: Add two exceptions to handle error path scenarios" into jb-mr2-dev
* commit '9ba564c7e205c4b278be61eec773a90a94451251': MediaDrm API: Add two exceptions to handle error path scenarios
Diffstat (limited to 'media/jni')
-rw-r--r--media/jni/android_media_MediaDrm.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/media/jni/android_media_MediaDrm.cpp b/media/jni/android_media_MediaDrm.cpp
index d1b499e..ec88949 100644
--- a/media/jni/android_media_MediaDrm.cpp
+++ b/media/jni/android_media_MediaDrm.cpp
@@ -219,12 +219,6 @@ static bool throwExceptionAsNecessary(
case ERROR_DRM_TAMPER_DETECTED:
drmMessage = "Invalid state";
break;
- case ERROR_DRM_NOT_PROVISIONED:
- drmMessage = "Not provisioned";
- break;
- case ERROR_DRM_DEVICE_REVOKED:
- drmMessage = "Device revoked";
- break;
default:
break;
}
@@ -238,6 +232,12 @@ static bool throwExceptionAsNecessary(
if (err == BAD_VALUE) {
jniThrowException(env, "java/lang/IllegalArgumentException", msg);
return true;
+ } else if (err == ERROR_DRM_NOT_PROVISIONED) {
+ jniThrowException(env, "android/media/NotProvisionedException", msg);
+ return true;
+ } else if (err == ERROR_DRM_DEVICE_REVOKED) {
+ jniThrowException(env, "android/media/DeniedByServerException", msg);
+ return true;
} else if (err != OK) {
String8 errbuf;
if (drmMessage != NULL) {
@@ -248,6 +248,7 @@ static bool throwExceptionAsNecessary(
msg = errbuf.string();
}
}
+ ALOGE("Illegal state exception: %s", msg);
jniThrowException(env, "java/lang/IllegalStateException", msg);
return true;
}
@@ -574,7 +575,7 @@ static void android_media_MediaDrm_native_setup(
if (err != OK) {
jniThrowException(
env,
- "android/media/MediaDrmException",
+ "android/media/UnsupportedSchemeException",
"Failed to instantiate drm object.");
return;
}