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

Side by Side Diff: libadblockplus-android/jni/JniLibrary.cpp

Issue 29345737: Issue 4146 - Fix failing UpdateCheckTest.testApplicationUpdateAvailable test in libadblockplus-andr… (Closed)
Patch Set: moved entry points to JniLibrary.cpp Created Sept. 14, 2016, 7:38 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 package org.adblockplus.libadblockplus; 18 #include "JniJsValue.h"
19 19
20 public class AdblockPlusException extends RuntimeException 20 jint JNI_OnLoad(JavaVM* vm, void* reserved)
21 { 21 {
22 private static final long serialVersionUID = -8127654134450836743L; 22 JNIEnv* env;
23 23 if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK)
24 public AdblockPlusException(final String message)
25 { 24 {
26 super(message); 25 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
27 } 26 }
28 27
29 public AdblockPlusException(final String message, final Throwable throwable) 28 JniJsValue_OnLoad(vm, env, reserved);
29
30 return JNI_VERSION_1_6;
31 }
32
33 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.
34 {
35 JNIEnv* env;
36 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.
30 { 37 {
31 super(message, throwable); 38 return;
32 } 39 }
33 40
34 public AdblockPlusException(final Throwable throwable) 41 JniJsValue_OnUnload(vm, env, reserved);
35 { 42 }
36 super(throwable);
37 }
38 }
OLDNEW
« libadblockplus-android/jni/JniJsValue.cpp ('K') | « libadblockplus-android/jni/JniJsValue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld