Fix unexpected exception from MediaHTTPService
Make CreateHTTPServiceInCurrentJavaContext() to call
the correct MediaHTTPService class constructor
Bug: 29321867
Test: manual ndk sample test
Change-Id: I23e1182668f2bb081edaf868c36499ba76e87feb
diff --git a/media/libstagefright/http/HTTPHelper.cpp b/media/libstagefright/http/HTTPHelper.cpp
index 77845e2..b895f03 100644
--- a/media/libstagefright/http/HTTPHelper.cpp
+++ b/media/libstagefright/http/HTTPHelper.cpp
@@ -42,11 +42,11 @@
env, env->FindClass("android/media/MediaHTTPService"));
CHECK(clazz.get() != NULL);
- jmethodID constructID = env->GetMethodID(clazz.get(), "<init>", "()V");
+ jmethodID constructID = env->GetMethodID(clazz.get(), "<init>", "(Ljava/util/List;)V");
CHECK(constructID != NULL);
ScopedLocalRef<jobject> httpServiceObj(
- env, env->NewObject(clazz.get(), constructID));
+ env, env->NewObject(clazz.get(), constructID, NULL));
sp<IMediaHTTPService> httpService;
if (httpServiceObj.get() != NULL) {