Commit Graph

8 Commits

Author SHA1 Message Date
Orion Hodson
a1a2ccb8d7 Move to renamed NDK symbol AFileDescriptor_getFd
Bug: 185256332
Test: TH
Change-Id: Ic13f1d9832d5ae5b6ae4b96323025d9b695fdaf9
2021-04-30 17:48:03 +01:00
Remi NGUYEN VAN
deed4cbcf9 Reduce framework-connectivity footprint
Cleanup framework-connectivity to reduce its memory and storage usage:
 - Build libframework-connectivity-jni using standard C and removing
   dependencies on libc++. This saves about 100kB of storage (40+60kB
   on the 32+64 bit variants).
 - Remove dependency on protobuffer libraries, as their usage has been
   removed. This saves about 15kB of storage.

From local measurements, the reduced code size also improves memory
usage.

This also removes a jarjar workaround for net-utils-device-common, as
the library is no longer used either.

Bug: 184111895
Test: device boots, connectivity working
Change-Id: Ibfbd0fe1098293812ae24812621752a7a44f9130
2021-04-02 10:18:00 +00:00
Remi NGUYEN VAN
6b0c407133 Remove dependency on libnetd_client
NetworkUtils can just use the NDK to achieve the same.

Also make sure network handles can have the local nameservers flag, for
the JNI API, and create/parse them accordingly in Network.

Bug: 171540887
Test: atest CtsNetTestCases (in particular MultinetworkApiTest,
          DnsResolverTest, NetworkTest)
Change-Id: I2e7b78263f7ca0cab9458854858a7423f6bd2854
2021-03-24 10:08:39 +00:00
Lorenzo Colitti
e8585ddf8b Re-implement NetworkUtils#queryUserAccess.
Currently, queryUserAccess talks to netd via FwmarkServer.
Doing this from the module would require exposing queryUserAccess
as an NDK API or reimplementing FwmarkClient.

Because queryUserAccess really only uses information that comes
from ConnectivityService/PermissionMonitor anyway, just use that
information without calling to net.

Test: atest HostsideVpnTests
Bug: 171540887
Change-Id: If855de1ea3e1fd2ed30f2795d9b4acfcf969a2dc
2021-03-23 13:20:44 +00:00
Remi NGUYEN VAN
56db6551f5 Merge "Add NDK API for getprocnetwork" into sc-dev 2021-03-23 07:11:06 +00:00
Remi NGUYEN VAN
31f329e987 Add NDK API for getprocnetwork
The API is the getter couterpart for setprocnetwork.
Use it in NetworkUtils so that the NDK API can be the source of truth
for the process network.

Bug: 171540887
Test: atest CtsNetTestCases
      Tests in change I311b58585033c2ca50ce5477ea9cd94b6f127507
Change-Id: Ie8f68cf1fa57deddb63324c1abf3d6fd5b0ef500
2021-03-23 01:01:06 +00:00
Remi NGUYEN VAN
c1f2d31b39 Use jniThrowErrnoException from JNIHelp
Use the jniThrowErrnoException that is available in JNIHelp, instead of
reimplementing in NetworkUtils.

Bug: 179229316
Test: device boots and has connectivity
Change-Id: I257a9d55ce1f5a7c588e209b4a89d3e7a3e09994
2021-03-19 13:44:11 +00:00
Remi NGUYEN VAN
c58c993dda Move NetworkUtils JNI out of core/jni
Keep the utilities included via a library, but move them out of
core/jni, and prepare a library to package them together with
framework-connectivity.

Also remove unnecessary dependencies in framework-connectivity.

Bug: 171540887
Test: device boots and has connectivity

Change-Id: I0b55dfe92f3cb6e848d79ac7953756f39aaa2597
2021-03-19 11:01:17 +00:00