9 Commits

Author SHA1 Message Date
Ken Chen
9c315eb11f Update data type and comments on tagSocket/untagSocket APIs
- Fix comment in version script to say LL-NDK, not NDK
- Use uint32_t for tag

Bug: 223423155
Test: CtsNetTestCases:android.net.TrafficStatsTest
Test: CtsNativeNetPlatformTestCases
Change-Id: Ifb819ed0adeb8f173b98c3f131a4bf2e0715dd4e
2022-03-31 00:28:15 +08:00
Ken Chen
a4a35a92ea Add tagSocket/untagSocket NDK APIs
Provide native APIs to tag the various sockets used for network
transfer, which helps apps tracking down data usage inside their app.

We've had equivalent Java APIs since API level 14.
https://developer.android.com/reference/android/net/TrafficStats.html#tagSocket(java.net.Socket)
https://developer.android.com/reference/android/net/TrafficStats.html#untagSocket(java.net.Socket)

Given that these Java APIs are implemented in native side, providing
NDK APIs directly will be easier for native users to use it.

Bug: 29761778
Bug: 202086915
Test: Tests in change Ic6554d9b98cef9b41b7eae06315d284c574c0a45
Change-Id: I802ce62f82199ce087bf8feb03afb26de1ce526e
2022-01-12 23:21:17 +08:00
Remi NGUYEN VAN
ba43fb8406 Add NDK API for getprocdns,setprocdns
The API allows callers to control the default network that is used for
DNS hostname resolution.

Test: atest CtsNetTestCases
      Tests in change I00143cafcd3eb1d71e8d5c7ea9c839a99dc6f4ce
Bug: 171540887
Merged-In: I42f0d9b17b3058f6e10fd2e651278b290f26667f
Change-Id: Id6c40145b8886a7ec6f2bd3a25ad85e8df32f4bb
2021-06-01 18:00:49 +09:00
Remi NGUYEN VAN
c2f03da27c 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
Merged-In: Ie8f68cf1fa57deddb63324c1abf3d6fd5b0ef500
Change-Id: If37c1480e8a6fe22ce0340858fcde052e8770923
2021-06-01 15:56:58 +09:00
Luke Huang
f3cc2b6aa5 Add control flags in asynchronous DNS query API
Test: built, flashed, booted
      cts test: NativeDnsAsyncTest

Change-Id: Ief04d99b2b289d95e54899572d28576d464037b8
2019-01-08 17:58:32 +08:00
Luke Huang
d0c47e6e1b Following commit for asynchronous DNS query API
Test: built, flashed, booted
      atest CtsNativeNetDnsTestCases

Change-Id: Ia0f54ff684d2ad37ca82d94bad4e4dd582783d85
2018-12-17 16:47:20 +08:00
Luke Huang
c17821cc11 Add asynchronous DNS query API
Adds support for asynchronous "raw" DNS API for clients.
API allows apps to use multinetworking capability correctly
and also allows other query types than A/AAAA.

Test: built, flashed, booted
      cts test: NativeDnsAsyncTest

Change-Id: I4701b76bd8f0094ef1bdd7c5371b54387914a91b
2018-12-12 04:17:41 +08:00
Lorenzo Colitti
e4fc6322a4 Change the netId to nethandle mapping.
Being able to update this handle is necessary to ensure that
system-only OTAs do not break vendor code that relies on
nethandles.

Bug: 63052780
Test: walleye builds, boots, networking works
Test: MultinetworkApiTest CTS tests passes
Change-Id: I049a4ad2610ca68b8f56377b63be7e5e8ce76039
2018-01-16 02:08:09 +09:00
Erik Kline
25f3b7bb2d multinetwork API: native implementation
Bug: 19537384
Change-Id: I04f4a7de2b1e583989b67a853df6ab50289c2185
2015-04-15 15:32:08 +09:00