Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus-android/jni/JniLibrary.cpp

Issue 29345737: Issue 4146 - Fix failing UpdateCheckTest.testApplicationUpdateAvailable test in libadblockplus-andr… (Closed)
Patch Set: codestyle, moved unload Created Sept. 15, 2016, 1:28 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « libadblockplus-android/jni/JniJsValue.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 58%
copy from libadblockplus-android/src/org/adblockplus/libadblockplus/AdblockPlusException.java
copy to libadblockplus-android/jni/JniLibrary.cpp
index 7e655ba71e65c7a8bfbfe9a4fa9c6b30a385ba55..7bd57987905223c8bd2410d5a7286c0e36fcab4a 100644
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/AdblockPlusException.java
+++ b/libadblockplus-android/jni/JniLibrary.cpp
@@ -15,24 +15,30 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-package org.adblockplus.libadblockplus;
+#include "JniJsValue.h"
-public class AdblockPlusException extends RuntimeException
-{
- private static final long serialVersionUID = -8127654134450836743L;
+#define JNI_REQUIRED_VERSION (JNI_VERSION_1_6)
Felix Dahlke 2016/09/15 15:05:56 I actually just noticed that there is already a de
anton 2016/09/16 05:48:44 Acknowledged.
- public AdblockPlusException(final String message)
+jint JNI_OnLoad(JavaVM* vm, void* reserved)
+{
+ JNIEnv* env;
+ if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_REQUIRED_VERSION) != JNI_OK)
{
- super(message);
+ return JNI_ERR;
}
- public AdblockPlusException(final String message, final Throwable throwable)
- {
- super(message, throwable);
- }
+ JniJsValue_OnLoad(vm, env, reserved);
- public AdblockPlusException(final Throwable throwable)
+ return JNI_REQUIRED_VERSION;
+}
+
+void JNI_OnUnload(JavaVM* vm, void* reserved)
+{
+ JNIEnv* env;
+ if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_REQUIRED_VERSION) != JNI_OK)
{
- super(throwable);
+ return;
}
-}
+
+ JniJsValue_OnUnload(vm, env, reserved);
+}
« no previous file with comments | « libadblockplus-android/jni/JniJsValue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld