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

Delta Between Two Patch Sets: libadblockplus-android/jni/JniLibrary.cpp

Issue 29345737: Issue 4146 - Fix failing UpdateCheckTest.testApplicationUpdateAvailable test in libadblockplus-andr… (Closed)
Left Patch Set: moved entry points to JniLibrary.cpp Created Sept. 14, 2016, 7:38 a.m.
Right Patch Set: using jni version define from Utils.h Created Sept. 16, 2016, 6:30 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « libadblockplus-android/jni/JniJsValue.cpp ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 #include "JniJsValue.h" 18 #include "JniJsValue.h"
19 19
anton 2016/09/16 11:06:04 added #include "Utils.h" for ABP_JNI_VERSION to be
20 jint JNI_OnLoad(JavaVM* vm, void* reserved) 20 jint JNI_OnLoad(JavaVM* vm, void* reserved)
21 { 21 {
22 JNIEnv* env; 22 JNIEnv* env;
23 if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) 23 if (vm->GetEnv(reinterpret_cast<void**>(&env), ABP_JNI_VERSION) != JNI_OK)
24 { 24 {
25 return JNI_ERR; 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
26 } 26 }
27 27
28 JniJsValue_OnLoad(vm, env, reserved); 28 JniJsValue_OnLoad(vm, env, reserved);
29 29
30 return JNI_VERSION_1_6; 30 return ABP_JNI_VERSION;
31 } 31 }
32 32
33 void JNI_OnUnload(JavaVM *vm, void *reserved) 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 { 34 {
35 JNIEnv* env; 35 JNIEnv* env;
36 if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) 36 if (vm->GetEnv(reinterpret_cast<void**>(&env), ABP_JNI_VERSION) != 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.
37 { 37 {
38 return; 38 return;
39 } 39 }
40 40
41 JniJsValue_OnUnload(vm, env, reserved); 41 JniJsValue_OnUnload(vm, env, reserved);
42 } 42 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld