Commit Graph

7 Commits

Author SHA1 Message Date
markchien
083606292b Replace throwErrnoException with JNIHelp jniThrowException
Rather than adding throwErrnoException local function, using standard
jniThrowException in JNIHelp.h.

Also improve the readability:
1. Use throwIOException for
    jniThrowExceptionFmt(env, "java/io/IOException", ...);
2. Use throwSoecktException for
    jniThrowExceptionFmt(env, "java/net/SocketException", ...);
then the code can fit to one line.

Test: atest TetheringPrivilegedTests (ErrnoException is
test in BpfMapTest)
Change-Id: I396771e2c68e319f510d7a4ea5f263d18d7fad9d
2021-07-20 10:15:01 +00:00
markchien
7052688dde Provide a easy way to access bpf maps from java
A wrapper for bpf map opening, reading/writing, and iteration.

Bug: 173167302
Test: atest BpfMapTest

Change-Id: I792b41978b322c9e4969cd7b6c35d6978ab86bc4
2021-01-11 17:43:27 +08:00
Orion Hodson
e5bd0dba21 Use libnetjniutils for JNI File Descriptor info
Drops use of deprecated API in libnativehelper and uses a common
helper that will be stable across releases.

Bug: 158749603
Test: m
Change-Id: Ic1a1811ffb9a1c207f562a180417e99df31e3502
2020-12-11 22:48:10 +00:00
Tyler Wear
90e4063fd2 tethering: DAD Proxy Daemon
DAD proxy daemon responsible for forwarding NS/NA between
tethered iface and upstream iface.

Change-Id: I2e58e10e7fa7dba6a6f63ad03b000549f3afc37e
2020-09-22 11:58:49 -07:00
Orion Hodson
0cdccd707f Sync with libnativehelper refactoring
jniGetFDFromFileDescriptor() is now a legacy method and moved to a
separate header.

Bug: 151443957
Bug: 158749603
Test: m
Change-Id: Icd06e9a315680c2251dbb9032a904dd6d66aa359
Merged-In: Icd06e9a315680c2251dbb9032a904dd6d66aa359
Exempt-From-Owner-Approval: cherry pick
(cherry picked from commit a5c4682505)
2020-06-24 14:13:13 +01:00
markchien
547e168540 Move offload config hidl usage from native to java
TetheringUtil JNI is too big that it statically linking hidl and its
dependency library. To remove these static libraries, calling hidl in java
directly instead of using JNI.

Bug: 148984662
Test: -build, flash, boot
      -manually ON/OFF tethering

Change-Id: Id5a9759eb453fddaf0c3b7a31da17224e35e963e
2020-02-10 15:25:19 +08:00
markchien
f87ebdcbb4 Change tetheroffloadjni to tetheringutilsjni
Rename tetheroffloadjni to tetheringutilsjni and move setupRaSocket
jni method from NetUtils into tetheringutilsjni.

Bug: 143195885
Test: -build, flash, boot
      -atest TetheringTests
      -Off/On hotspot with ipv6 upstream

Change-Id: Ib68eb6999bbe2d3ca97e68712f22b105311ef800
2020-01-07 07:42:13 +00:00