Loading core/jni/Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -176,7 +176,8 @@ LOCAL_C_INCLUDES += \ external/icu4c/common \ external/jpeg \ external/harfbuzz/src \ frameworks/opt/emoji frameworks/opt/emoji \ libcore/include LOCAL_SHARED_LIBRARIES := \ libexpat \ Loading core/jni/android/graphics/Graphics.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ #include <android_runtime/AndroidRuntime.h> void doThrowNPE(JNIEnv* env) { jniThrowException(env, "java/lang/NullPointerException", NULL); jniThrowNullPointerException(env, NULL); } void doThrowAIOOBE(JNIEnv* env) { Loading @@ -19,7 +19,7 @@ void doThrowAIOOBE(JNIEnv* env) { } void doThrowRE(JNIEnv* env, const char* msg) { jniThrowException(env, "java/lang/RuntimeException", msg); jniThrowRuntimeException(env, msg); } void doThrowIAE(JNIEnv* env, const char* msg) { Loading core/jni/android/graphics/NinePatch.cpp +13 −14 Original line number Diff line number Diff line Loading @@ -58,8 +58,7 @@ public: static void validateNinePatchChunk(JNIEnv* env, jobject, jint, jbyteArray obj) { if (env->GetArrayLength(obj) < (int) (sizeof(Res_png_9patch))) { jniThrowException(env, "java/lang/RuntimeException", "Array too small for chunk."); jniThrowRuntimeException(env, "Array too small for chunk."); return; } Loading core/jni/android_hardware_Camera.cpp +16 −19 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ sp<Camera> get_native_camera(JNIEnv *env, jobject thiz, JNICameraContext** pCont } LOGV("get_native_camera: context=%p, camera=%p", context, camera.get()); if (camera == 0) { jniThrowException(env, "java/lang/RuntimeException", "Method called after release()"); jniThrowRuntimeException(env, "Method called after release()"); } if (pContext != NULL) *pContext = context; Loading Loading @@ -232,8 +232,7 @@ void JNICameraContext::copyAndPost(JNIEnv* env, const sp<IMemory>& dataPtr, int break; } default: { jniThrowException(env, "java/lang/RuntimeException", "Unsupported message type"); jniThrowRuntimeException(env, "Unsupported message type"); return; } } Loading Loading @@ -391,8 +390,7 @@ static void android_hardware_Camera_getCameraInfo(JNIEnv *env, jobject thiz, CameraInfo cameraInfo; status_t rc = Camera::getCameraInfo(cameraId, &cameraInfo); if (rc != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "Fail to get camera info"); jniThrowRuntimeException(env, "Fail to get camera info"); return; } env->SetIntField(info_obj, fields.facing, cameraInfo.facing); Loading @@ -406,20 +404,19 @@ static void android_hardware_Camera_native_setup(JNIEnv *env, jobject thiz, sp<Camera> camera = Camera::connect(cameraId); if (camera == NULL) { jniThrowException(env, "java/lang/RuntimeException", "Fail to connect to camera service"); jniThrowRuntimeException(env, "Fail to connect to camera service"); return; } // make sure camera hardware is alive if (camera->getStatus() != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "Camera initialization failed"); jniThrowRuntimeException(env, "Camera initialization failed"); return; } jclass clazz = env->GetObjectClass(thiz); if (clazz == NULL) { jniThrowException(env, "java/lang/RuntimeException", "Can't find android/hardware/Camera"); jniThrowRuntimeException(env, "Can't find android/hardware/Camera"); return; } Loading Loading @@ -508,7 +505,7 @@ static void android_hardware_Camera_startPreview(JNIEnv *env, jobject thiz) if (camera == 0) return; if (camera->startPreview() != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "startPreview failed"); jniThrowRuntimeException(env, "startPreview failed"); return; } } Loading Loading @@ -564,7 +561,7 @@ static void android_hardware_Camera_autoFocus(JNIEnv *env, jobject thiz) if (c == 0) return; if (c->autoFocus() != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "autoFocus failed"); jniThrowRuntimeException(env, "autoFocus failed"); } } Loading @@ -576,7 +573,7 @@ static void android_hardware_Camera_cancelAutoFocus(JNIEnv *env, jobject thiz) if (c == 0) return; if (c->cancelAutoFocus() != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "cancelAutoFocus failed"); jniThrowRuntimeException(env, "cancelAutoFocus failed"); } } Loading Loading @@ -606,7 +603,7 @@ static void android_hardware_Camera_takePicture(JNIEnv *env, jobject thiz, int m } if (camera->takePicture(msgType) != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "takePicture failed"); jniThrowRuntimeException(env, "takePicture failed"); return; } } Loading @@ -624,7 +621,7 @@ static void android_hardware_Camera_setParameters(JNIEnv *env, jobject thiz, jst env->ReleaseStringCritical(params, str); } if (camera->setParameters(params8) != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "setParameters failed"); jniThrowRuntimeException(env, "setParameters failed"); return; } } Loading Loading @@ -657,7 +654,7 @@ static void android_hardware_Camera_lock(JNIEnv *env, jobject thiz) if (camera == 0) return; if (camera->lock() != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "lock failed"); jniThrowRuntimeException(env, "lock failed"); } } Loading @@ -668,7 +665,7 @@ static void android_hardware_Camera_unlock(JNIEnv *env, jobject thiz) if (camera == 0) return; if (camera->unlock() != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "unlock failed"); jniThrowRuntimeException(env, "unlock failed"); } } Loading @@ -684,7 +681,7 @@ static void android_hardware_Camera_startSmoothZoom(JNIEnv *env, jobject thiz, j sprintf(msg, "invalid zoom value=%d", value); jniThrowException(env, "java/lang/IllegalArgumentException", msg); } else if (rc != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "start smooth zoom failed"); jniThrowRuntimeException(env, "start smooth zoom failed"); } } Loading @@ -695,7 +692,7 @@ static void android_hardware_Camera_stopSmoothZoom(JNIEnv *env, jobject thiz) if (camera == 0) return; if (camera->sendCommand(CAMERA_CMD_STOP_SMOOTH_ZOOM, 0, 0) != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "stop smooth zoom failed"); jniThrowRuntimeException(env, "stop smooth zoom failed"); } } Loading @@ -707,7 +704,7 @@ static void android_hardware_Camera_setDisplayOrientation(JNIEnv *env, jobject t if (camera == 0) return; if (camera->sendCommand(CAMERA_CMD_SET_DISPLAY_ORIENTATION, value, 0) != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "set display orientation failed"); jniThrowRuntimeException(env, "set display orientation failed"); } } Loading core/jni/android_media_JetPlayer.cpp +23 −24 Original line number Diff line number Diff line Loading @@ -141,7 +141,6 @@ android_media_JetPlayer_loadFromFile(JNIEnv *env, jobject thiz, jstring path) const char *pathStr = env->GetStringUTFChars(path, NULL); if (pathStr == NULL) { // Out of memory LOGE("android_media_JetPlayer_openFile(): aborting, out of memory"); jniThrowException(env, "java/lang/RuntimeException", "Out of memory"); return JNI_FALSE; } Loading Loading
core/jni/Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -176,7 +176,8 @@ LOCAL_C_INCLUDES += \ external/icu4c/common \ external/jpeg \ external/harfbuzz/src \ frameworks/opt/emoji frameworks/opt/emoji \ libcore/include LOCAL_SHARED_LIBRARIES := \ libexpat \ Loading
core/jni/android/graphics/Graphics.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ #include <android_runtime/AndroidRuntime.h> void doThrowNPE(JNIEnv* env) { jniThrowException(env, "java/lang/NullPointerException", NULL); jniThrowNullPointerException(env, NULL); } void doThrowAIOOBE(JNIEnv* env) { Loading @@ -19,7 +19,7 @@ void doThrowAIOOBE(JNIEnv* env) { } void doThrowRE(JNIEnv* env, const char* msg) { jniThrowException(env, "java/lang/RuntimeException", msg); jniThrowRuntimeException(env, msg); } void doThrowIAE(JNIEnv* env, const char* msg) { Loading
core/jni/android/graphics/NinePatch.cpp +13 −14 Original line number Diff line number Diff line Loading @@ -58,8 +58,7 @@ public: static void validateNinePatchChunk(JNIEnv* env, jobject, jint, jbyteArray obj) { if (env->GetArrayLength(obj) < (int) (sizeof(Res_png_9patch))) { jniThrowException(env, "java/lang/RuntimeException", "Array too small for chunk."); jniThrowRuntimeException(env, "Array too small for chunk."); return; } Loading
core/jni/android_hardware_Camera.cpp +16 −19 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ sp<Camera> get_native_camera(JNIEnv *env, jobject thiz, JNICameraContext** pCont } LOGV("get_native_camera: context=%p, camera=%p", context, camera.get()); if (camera == 0) { jniThrowException(env, "java/lang/RuntimeException", "Method called after release()"); jniThrowRuntimeException(env, "Method called after release()"); } if (pContext != NULL) *pContext = context; Loading Loading @@ -232,8 +232,7 @@ void JNICameraContext::copyAndPost(JNIEnv* env, const sp<IMemory>& dataPtr, int break; } default: { jniThrowException(env, "java/lang/RuntimeException", "Unsupported message type"); jniThrowRuntimeException(env, "Unsupported message type"); return; } } Loading Loading @@ -391,8 +390,7 @@ static void android_hardware_Camera_getCameraInfo(JNIEnv *env, jobject thiz, CameraInfo cameraInfo; status_t rc = Camera::getCameraInfo(cameraId, &cameraInfo); if (rc != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "Fail to get camera info"); jniThrowRuntimeException(env, "Fail to get camera info"); return; } env->SetIntField(info_obj, fields.facing, cameraInfo.facing); Loading @@ -406,20 +404,19 @@ static void android_hardware_Camera_native_setup(JNIEnv *env, jobject thiz, sp<Camera> camera = Camera::connect(cameraId); if (camera == NULL) { jniThrowException(env, "java/lang/RuntimeException", "Fail to connect to camera service"); jniThrowRuntimeException(env, "Fail to connect to camera service"); return; } // make sure camera hardware is alive if (camera->getStatus() != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "Camera initialization failed"); jniThrowRuntimeException(env, "Camera initialization failed"); return; } jclass clazz = env->GetObjectClass(thiz); if (clazz == NULL) { jniThrowException(env, "java/lang/RuntimeException", "Can't find android/hardware/Camera"); jniThrowRuntimeException(env, "Can't find android/hardware/Camera"); return; } Loading Loading @@ -508,7 +505,7 @@ static void android_hardware_Camera_startPreview(JNIEnv *env, jobject thiz) if (camera == 0) return; if (camera->startPreview() != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "startPreview failed"); jniThrowRuntimeException(env, "startPreview failed"); return; } } Loading Loading @@ -564,7 +561,7 @@ static void android_hardware_Camera_autoFocus(JNIEnv *env, jobject thiz) if (c == 0) return; if (c->autoFocus() != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "autoFocus failed"); jniThrowRuntimeException(env, "autoFocus failed"); } } Loading @@ -576,7 +573,7 @@ static void android_hardware_Camera_cancelAutoFocus(JNIEnv *env, jobject thiz) if (c == 0) return; if (c->cancelAutoFocus() != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "cancelAutoFocus failed"); jniThrowRuntimeException(env, "cancelAutoFocus failed"); } } Loading Loading @@ -606,7 +603,7 @@ static void android_hardware_Camera_takePicture(JNIEnv *env, jobject thiz, int m } if (camera->takePicture(msgType) != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "takePicture failed"); jniThrowRuntimeException(env, "takePicture failed"); return; } } Loading @@ -624,7 +621,7 @@ static void android_hardware_Camera_setParameters(JNIEnv *env, jobject thiz, jst env->ReleaseStringCritical(params, str); } if (camera->setParameters(params8) != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "setParameters failed"); jniThrowRuntimeException(env, "setParameters failed"); return; } } Loading Loading @@ -657,7 +654,7 @@ static void android_hardware_Camera_lock(JNIEnv *env, jobject thiz) if (camera == 0) return; if (camera->lock() != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "lock failed"); jniThrowRuntimeException(env, "lock failed"); } } Loading @@ -668,7 +665,7 @@ static void android_hardware_Camera_unlock(JNIEnv *env, jobject thiz) if (camera == 0) return; if (camera->unlock() != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "unlock failed"); jniThrowRuntimeException(env, "unlock failed"); } } Loading @@ -684,7 +681,7 @@ static void android_hardware_Camera_startSmoothZoom(JNIEnv *env, jobject thiz, j sprintf(msg, "invalid zoom value=%d", value); jniThrowException(env, "java/lang/IllegalArgumentException", msg); } else if (rc != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "start smooth zoom failed"); jniThrowRuntimeException(env, "start smooth zoom failed"); } } Loading @@ -695,7 +692,7 @@ static void android_hardware_Camera_stopSmoothZoom(JNIEnv *env, jobject thiz) if (camera == 0) return; if (camera->sendCommand(CAMERA_CMD_STOP_SMOOTH_ZOOM, 0, 0) != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "stop smooth zoom failed"); jniThrowRuntimeException(env, "stop smooth zoom failed"); } } Loading @@ -707,7 +704,7 @@ static void android_hardware_Camera_setDisplayOrientation(JNIEnv *env, jobject t if (camera == 0) return; if (camera->sendCommand(CAMERA_CMD_SET_DISPLAY_ORIENTATION, value, 0) != NO_ERROR) { jniThrowException(env, "java/lang/RuntimeException", "set display orientation failed"); jniThrowRuntimeException(env, "set display orientation failed"); } } Loading
core/jni/android_media_JetPlayer.cpp +23 −24 Original line number Diff line number Diff line Loading @@ -141,7 +141,6 @@ android_media_JetPlayer_loadFromFile(JNIEnv *env, jobject thiz, jstring path) const char *pathStr = env->GetStringUTFChars(path, NULL); if (pathStr == NULL) { // Out of memory LOGE("android_media_JetPlayer_openFile(): aborting, out of memory"); jniThrowException(env, "java/lang/RuntimeException", "Out of memory"); return JNI_FALSE; } Loading