am 68bf6eb4: am d6904819: Merge "Throw an exception instead of crash when a surface does not have a binding surface texture" into jb-mr1-dev

* commit '68bf6eb411afff2f3233ce7447914b34af6b1b96':
  Throw an exception instead of crash when a surface does not have a binding surface texture
This commit is contained in:
James Dong
2012-10-04 15:27:44 -07:00
committed by Android Git Automerger

View File

@@ -274,6 +274,11 @@ setVideoSurface(JNIEnv *env, jobject thiz, jobject jsurface, jboolean mediaPlaye
sp<Surface> surface(android_view_Surface_getSurface(env, jsurface));
if (surface != NULL) {
new_st = surface->getSurfaceTexture();
if (new_st == NULL) {
jniThrowException(env, "java/lang/IllegalArgumentException",
"The surface does not have a binding SurfaceTexture!");
return;
}
new_st->incStrong(thiz);
} else {
jniThrowException(env, "java/lang/IllegalArgumentException",