Commit Graph

45 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
ca551ce981 Merge "Add API for NetworkStack to start captive portal" 2019-02-07 02:39:17 +00:00
Aaron Huang
a63c40e0de [KA07] Drop TCP keepalive ack packets
To support TCP keepalive offload, APF filter needs to add program
for dropping keepalive ack packets when offload is starting.

Bug: 114151147
Test: runtest frameworks-net -c android.net.apf.ApfTest
Change-Id: If16a9bc04eb29dfedb950b6e4c85fe9ad4cf259f
2019-02-06 22:51:49 +09:00
junyulai
352dc2f202 [KA04] Expose TCP socket keepalive API
The new set of API allows applications to request keepalives
offload for established TCP sockets over wifi.

However, the application must not write to or read from the
socket after calling this method, until specific callbacks are
called.

Bug: 114151147
Test: atest FrameworksNetTests FrameworksWifiTests NetworkStackTests

Change-Id: I3880505dbc35fefa34ef6c79555458ecf5d296a4
2019-02-06 22:51:42 +09:00
Remi NGUYEN VAN
dc48356147 Add API for NetworkStack to start captive portal
Endpoints protected with INTERACT_ACROSS_USERS_FULL, such as
startActivityAsUser, should only be used by modules signed with the
platform cert. The NetworkStack needs to have the system server start
the application so this restriction can be applied.

Bug: 123846255
Test: flashed, captive portal works from primary and secondary user
Change-Id: Ib3e427b3fd03ced80c02985e795f79b096a2ec9a
2019-02-06 16:38:32 +09:00
Bernie Innocenti
c3586eaa4d Give owneship of packages/NetworkStack to Android Core Networking
Test: ../../build/make/tools/checkowners.py packages/NetworkStack/OWNERS
Change-Id: I6254f1ac2a24611ca6901f8f940d9e5babaaf373
2019-02-06 16:20:35 +09:00
Remi NGUYEN VAN
0fe59007ce Merge "Add NetworkStackPermissionStub definitions" 2019-01-31 14:13:22 +00:00
Remi NGUYEN VAN
74b1c8626e Merge "Prepare CaptivePortalLogin for system_current" 2019-01-31 12:46:00 +00:00
Remi NGUYEN VAN
d8c75a0438 Add NetworkStackPermissionStub definitions
The NetworkStackPermissionStub package is used to enforce that
permissions used by the NetworkStack are only used in packages
sharing signature with NetworkStackPermissionStub.

Permissions defined in this package are intended to be used only by the
NetworkStack: both NetworkStack and the stub APK will be signed with
a dedicated certificate to ensure that, with permissions being signature
permissions.

This APK *must* be installed, even if the NetworkStack app is not
installed, because otherwise, any application will be able to define
this permission and the system will give that application full access
to the network stack.

Test: flashed, booted
Bug: 112869080
Change-Id: Ia13a9e6a703cb7b4403697a7f7bfff0f6f3b813e
2019-01-31 21:16:13 +09:00
Remi NGUYEN VAN
47274275cf Prepare CaptivePortalLogin for system_current
Includes small changes to stop using non-SystemApi endpoints.

Test: make CaptivePortalLogin
Test: flashed, login works, SSL certificate invalid flow works
Bug: 112869080
Merged-In: Ic6ce98942959705ea7ef14a7a62d33e3abf7eb72
Change-Id: Ie7ea3bab6aa8629ce4c111adee0c0699d95d4b0e
2019-01-31 18:14:54 +09:00
Remi NGUYEN VAN
3b906878f8 Fix bluetooth tethering on multi-user
Bluetooth runs as UID 1001002 when on a secondary user. With this change
the NetworkStack verifies that the calling UID matches the Bluetooth app
regardless of the user.

Test: flashed, BT reverse tethering still working as primary user
      (no option to turn on as secondary user on phones)
Bug: 123655057
Change-Id: I23f9c5fa40f3bb676ac65dd8c15106c9d78309a4
2019-01-31 16:03:21 +09:00
Remi NGUYEN VAN
55849979a5 Merge "Add SystemApi for captive portal metrics" 2019-01-30 22:24:12 +00:00
Remi NGUYEN VAN
de60221ec8 Add SystemApi for captive portal metrics
The metrics go through NetworkMonitor in the NetworkStack so that they
can be upgraded to new metrics in the future.

Test: flashed, captive portal login works, metrics shown in events log
Bug: 112869080
Merged-In: I4bccfbd87bae5b2d65e45c7a5918aa45ab5d76e8
Change-Id: Ib5e2126788f8d56a00a56d7efcd33c5f9a37a6de
2019-01-30 22:54:27 +09:00
Remi NGUYEN VAN
4c30b419f8 Compile NetworkStack as system_current
Test: make NetworkStack
Test: flashed, WiFi and tethering working
Bug: 112869080
Change-Id: I2d805c0fefe271199f4f0e0d49d91e03f41a7eef
2019-01-30 10:23:29 +09:00
Remi NGUYEN VAN
231b52bc03 Remove last NetworkStack usage of hidden APIs
Includes various small changes to stop using hidden APIs

Test: make NetworkStack
Test: flashed, booted, WiFi and tethering working
Bug: 112869080
Change-Id: Id2830795a444f484b377ed6437435a1cd833697a
2019-01-30 10:23:24 +09:00
Treehugger Robot
4a838a68d6 Merge "Move FdEventsReader to the shared area." 2019-01-29 11:45:15 +00:00
Chalard Jean
0bf364d92e Move FdEventsReader to the shared area.
This is necessary both in the network stack app and the
framework.

Test: FrameworksNetTests
Change-Id: I48af0ab29405501f0581a6c0c9ce6e5d4a32c8b4
2019-01-29 18:35:11 +09:00
Remi NGUYEN VAN
1bbed8a3b8 Run IpClientLinkObserver on Binder thread
This restores previous behavior, where callbacks would not be called on
the IpClient handler thread.

Test: atest FrameworksNetTests NetworkStackTests
Test: flashed, WiFi works
Bug: 123062477
Change-Id: I3015566b0922d76ac7cf70579a1de3e033bf7b4a
2019-01-29 17:09:01 +09:00
Remi NGUYEN VAN
31d7447e04 Remove IpClient usage of NetworkManagementService
Use the new NetworkObserverRegistry instead.

Test: atest FrameworksNetTests NetworkStackTests
Test: flashed, WiFi working fine
Bug: 112869080
Change-Id: If16ecfd6489f86afec67c22b4c3692cd68f4edbf
2019-01-29 11:37:01 +09:00
Remi NGUYEN VAN
567cc7890a Merge "Add hidden utils and constants to NetworkStack" 2019-01-28 11:08:00 +00:00
Remi NGUYEN VAN
b8bbc48dee Merge "Move NetworkUtils used by NetworkStack" 2019-01-28 09:06:20 +00:00
Remi NGUYEN VAN
375b3c075d Merge "Add NetworkObserverRegistry to NetworkStack" 2019-01-28 08:54:06 +00:00
Remi NGUYEN VAN
f4fb1b5251 Merge "Add NetworkStack tests to postsubmit" 2019-01-28 08:53:13 +00:00
Remi NGUYEN VAN
9188b49259 Merge "Add NetworkStack networking deps to SystemApi" 2019-01-28 08:12:55 +00:00
Remi NGUYEN VAN
e4195cd6ed Add NetworkObserverRegistry to NetworkStack
The NetworkObserverRegistry will replace usage of
NetworkManagementService in the app.

Test: m, booted, WiFi working
Bug: 112869080
Change-Id: Ic7f0114d0c9361dd2408e47bb04a8dd44a908a47
2019-01-28 14:55:50 +09:00
Remi NGUYEN VAN
3ba6c0d56d Add hidden utils and constants to NetworkStack
Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: I1a803f7954ab760294436226d6c1cffb934e98f9
2019-01-28 13:45:27 +09:00
Remi NGUYEN VAN
e88516f13b Move NetworkUtils used by NetworkStack
Depending on usage move into NetworkStackUtils or shared
Inet4AddressUtils.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Merged-In: Ie20dcee375b377236004a7689890729493aca857
Change-Id: Ib8d000529872796022706a35050fdc2c7141f2ab
2019-01-28 13:45:17 +09:00
Remi NGUYEN VAN
a4bcc86dbe Add NetworkStack networking deps to SystemApi
Cherry-pick with conflicts fixed in CaptivePortalLoginActivity imports.
Test: atest FrameworksNetTests
Bug: 112869080
Merged-In: Id59dc06fb85e4ac88098f56b621ec880610759ce
Change-Id: I3c05e8fdd70497426d4fa433295c4fbdad07d9c9
2019-01-28 13:28:35 +09:00
Remi NGUYEN VAN
bd726ba33a Add NetworkStack tests to postsubmit
The NetworkStack tests were unit tests in FrameworksNetTests, but were
moved out so were no longer run in presubmit.
After a while the tests should be moved to presubmit.

Test: atest NetworkStackTests
Change-Id: I06ddcafd6de6d9029ac710f0fc3c4f2d1d705c01
2019-01-25 13:24:05 +09:00
Remi NGUYEN VAN
89485143f1 Fix IpClientTest
NetworkStackTests is run with a version of mockito that allows mocking
final methods, which broke mocking of the ConnectivityService.

Test: atest NetworkStackTests
Change-Id: I430fe12216c43a0c4265a504dbefafad37c09291
2019-01-24 20:14:48 +09:00
Remi NGUYEN VAN
e693d49c0a Merge changes I1250730c,I7d00848c
* changes:
  Create a wrapper for IpClient
  Move IpClient to NetworkStack
2019-01-23 15:05:00 +00:00
Lorenzo Colitti
ed3168e9e3 Stop depending on the ConnectivityService default request.
This avoids the need to expose ConnectivityService implementation
details as @SystemApi and the complexities that would be required
to make NetworkCapabilities parcelable in stable AIDL.

Bug: 112869080
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: Icd5d25b9b8e9b7a7d1899b000c92dc4976c3b3d7
2019-01-23 18:10:06 +09:00
Remi NGUYEN VAN
3c600a15a1 Move IpClient to NetworkStack
Test: atest FrameworksNetTests NetworkStackTests
Bug: b/112869080
Change-Id: I7d00848c052382cd1b6ce458868bed6a1e9e8ec5
2019-01-23 16:44:21 +09:00
Remi NGUYEN VAN
491f53523a Merge changes Ieef54d84,Ica3e88c2
* changes:
  Remove NetworkStack dependencies on hidden members
  Expose ServiceSpecificException as @SystemApi.
2019-01-22 13:00:10 +00:00
Remi NGUYEN VAN
c1c02dcb65 Remove NetworkStack dependencies on hidden members
- DhcpClient only shares its handler with IpClient, and NetworkMonitor
   has its own handler: remove Protocol.BASE_DHCP,
   Protocol.BASE_NETWORK_MONITOR
 - Remove dependency on Network.netid in NetworkMonitor
 - Remove dependency on Sets.newArraySet in DhcpServingParams
 - Remove dependency on formatDuration() in DhcpClient
 - Replace isMetered() with hasCapability() in NetworkMonitor
 - Use WifiManager.isScanAlwaysAvailable instead of reading setting

Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: Ieef54d847ddc081fb33cbad0b050b06d2e52548e
2019-01-22 18:48:12 +09:00
Remi NGUYEN VAN
811f6385be Add SystemApi utility for raw sockets.
Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: Id228bf3317b6933314174571697ee256b2f18452
2019-01-22 17:50:33 +09:00
Remi NGUYEN VAN
8586a43f31 Merge "Add NetworkStack metrics to system API" 2019-01-22 07:48:39 +00:00
Remi NGUYEN VAN
7b84fb336f Add NetworkStack metrics to system API
Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: Ie52c55f248c173e2a5ee603ecd004fbac9004ac1
2019-01-21 23:24:41 +00:00
Remi NGUYEN VAN
69b967f5d0 Allow Bluetooth to bind to NetworkStack
Test: flashed, verified bluetooth tethering gets IP address
Bug: b/112869080
Change-Id: Idfbfdf54754fea46eb0099b9b9a3bdc29dd241e0
2019-01-21 18:25:01 +09:00
Remi NGUYEN VAN
8865471c2e Merge "Add ACCESS_COARSE_LOCATION to NetworkStack app" 2019-01-15 08:00:51 +00:00
Chiachang Wang
1cb95499ec Add dns signal count into validation log for debugging
Dns signal may need to reevaluate the threshold if force
reevaluation is triggered and actually a stall. Provide dns
signal count while force reevaluation is triggered to help
debugging.

Bug: 113916551
Test: atest NetworkStackTests
Change-Id: Ia762752a41a4bb78ba9844917cbede7aeb2f0fc2
2019-01-15 10:32:48 +08:00
Remi NGUYEN VAN
41bd2b9c37 Add ACCESS_COARSE_LOCATION to NetworkStack app
Bug: 122809947
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I6e71c2d594abab0b4021fefe012b4e7c70a900f7
2019-01-15 11:14:48 +09:00
Remi NGUYEN VAN
e67b0c3aee Move NetworkMonitor to NetworkStack
Bug: b/112869080
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I1b8b6a3f4390adbabf92fb9e48da61c47b08b2ec
2019-01-11 09:59:11 +09:00
Remi NGUYEN VAN
0e3d0923a6 Move DhcpServer to NetworkStack app
Test: atest FrameworksNetTests && atest NetworkStackTests
Bug: b/112869080

Change-Id: I96c40e63e9ceb37b67705bdd4d120307e114715b
2019-01-09 15:42:16 +09:00
Remi NGUYEN VAN
1c427ab3c4 Change package name for NetworkStack
Test: flashed, booted, apk started as expected
Bug: b/112869080
Change-Id: I8aaf5a89ffff7bba1228ea7214e662acbe47e776
2019-01-08 16:58:21 +09:00
Remi NGUYEN VAN
c094a5402c Add NetworkStack app
The app is not started yet, and does not contain any service for now.

Test: built, booted
Bug: b/112869080
Change-Id: Id5a0fd02c891100e85d86b1040e53beec3581950
2018-12-25 11:42:42 +09:00