Merge "Load JNI in all classes that have native methods."

This commit is contained in:
Lorenzo Colitti
2021-02-12 03:19:00 +00:00
committed by Gerrit Code Review
3 changed files with 8 additions and 1 deletions

View File

@@ -36,6 +36,10 @@ import java.util.Objects;
* {@hide}
*/
public class TetheringUtils {
static {
System.loadLibrary("tetherutilsjni");
}
public static final byte[] ALL_NODES = new byte[] {
(byte) 0xff, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
};

View File

@@ -41,6 +41,10 @@ import java.util.function.BiConsumer;
* @param <V> the value of the map.
*/
public class BpfMap<K extends Struct, V extends Struct> implements AutoCloseable {
static {
System.loadLibrary("tetherutilsjni");
}
// Following definitions from kernel include/uapi/linux/bpf.h
public static final int BPF_F_RDWR = 0;
public static final int BPF_F_RDONLY = 1 << 3;

View File

@@ -82,7 +82,6 @@ public class TetheringService extends Service {
*/
@VisibleForTesting
public Tethering makeTethering(TetheringDependencies deps) {
System.loadLibrary("tetherutilsjni");
return new Tethering(deps);
}