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
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
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
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
Use the jniThrowErrnoException that is available in JNIHelp, instead of
reimplementing in NetworkUtils.
Bug: 179229316
Test: device boots and has connectivity
Change-Id: I257a9d55ce1f5a7c588e209b4a89d3e7a3e09994
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