Index: libadblockplus-android/jni/JniLibrary.cpp |
diff --git a/libadblockplus-android/src/org/adblockplus/libadblockplus/AdblockPlusException.java b/libadblockplus-android/jni/JniLibrary.cpp |
similarity index 61% |
copy from libadblockplus-android/src/org/adblockplus/libadblockplus/AdblockPlusException.java |
copy to libadblockplus-android/jni/JniLibrary.cpp |
index 7e655ba71e65c7a8bfbfe9a4fa9c6b30a385ba55..b51a8825bbefe6e85ff93e6445a60f910dd6178a 100644 |
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/AdblockPlusException.java |
+++ b/libadblockplus-android/jni/JniLibrary.cpp |
@@ -15,24 +15,28 @@ |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
-package org.adblockplus.libadblockplus; |
+#include "JniJsValue.h" |
-public class AdblockPlusException extends RuntimeException |
+jint JNI_OnLoad(JavaVM* vm, void* reserved) |
{ |
- private static final long serialVersionUID = -8127654134450836743L; |
- |
- public AdblockPlusException(final String message) |
+ JNIEnv* env; |
+ if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) |
{ |
- super(message); |
+ return JNI_ERR; |
Felix Dahlke
2016/09/15 13:01:19
Can we actually return JNI_ERR here? How I interpr
anton
2016/09/15 13:18:11
As it's written here (https://developer.android.co
|
} |
- public AdblockPlusException(final String message, final Throwable throwable) |
- { |
- super(message, throwable); |
- } |
+ JniJsValue_OnLoad(vm, env, reserved); |
+ |
+ return JNI_VERSION_1_6; |
+} |
- public AdblockPlusException(final Throwable throwable) |
+void JNI_OnUnload(JavaVM *vm, void *reserved) |
Felix Dahlke
2016/09/15 13:01:19
Nit: Same issue with the asterisks again, should b
anton
2016/09/15 13:18:11
Acknowledged.
anton
2016/09/15 13:18:12
Acknowledged.
|
+{ |
+ JNIEnv* env; |
+ if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) |
Felix Dahlke
2016/09/15 13:01:19
Can we use a constant for the required JNI version
anton
2016/09/15 13:18:12
Acknowledged.
|
{ |
- super(throwable); |
+ return; |
} |
-} |
+ |
+ JniJsValue_OnUnload(vm, env, reserved); |
+} |