Commit Graph

91 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
06d8067975 Merge changes I9dbbf904,Iebc174ed
* changes:
  Move NetworkStackTests to presubmit
  Remove NetworkStack test dependency on testutils
2019-03-11 02:06:27 +00:00
Treehugger Robot
a6f3476476 Merge "Give Telephony the permissions to access the network stack." 2019-03-08 15:55:53 +00:00
Bernie Innocenti
e5e3ac639b Merge "Add junyulai@ as owner of the core networking dirs" 2019-03-08 15:21:01 +00:00
Bernie Innocenti
ea89cf2c6e Add junyulai@ as owner of the core networking dirs
Also removed emeritus accounts ek@ and silberst@ from various places.
A cleanup using 'include' would probably be in order...

Test: N/A
Change-Id: I575e60dd5e600e42d9571ce8e8d7661d30e99bfe
2019-03-08 13:04:05 +00:00
Chalard Jean
12aaf7e2ef Give Telephony the permissions to access the network stack.
Test: manual
Change-Id: I28308f421aa955fe110b50452b115a0178b24745
2019-03-08 20:43:10 +09:00
Remi NGUYEN VAN
d9c313d450 Move NetworkStackTests to presubmit
The tests have been green in postsubmit for a while and run very
quickly.

Test: atest NetworkStackTests
Change-Id: I9dbbf9046dc0878c355a5ae791e31166038df796
2019-03-08 18:08:48 +09:00
Remi NGUYEN VAN
22cd685c0a Remove NetworkStack test dependency on testutils
frameworks-base-testutils is close to unused in the tests, and has the
side-effect of adding some unrelated tests to be run in
NetworkStackTests like TestLooperTest. TestLooperTest is also failing in
some cases.

Bug: 127908503
Test: atest NetworkStackTests
Change-Id: Iebc174ed1362e8c341d765129a7fc51f8ed1999d
2019-03-08 18:05:41 +09:00
Chiachang Wang
e43f162371 Not to use any() to verify DataStallDetectionStats
Build a empty DataStallDetectionStats object instead of use
any() to do the verification to prevent NPE while trying to
write the metrics.

Bug: 120452078
Test: atest NetworkStackTests
Change-Id: Ib9f3e56195a539a5ca4826b4aad0e38945a9a3a7
2019-03-08 14:34:19 +08:00
Remi NGUYEN VAN
3da7809ae4 Merge "Fix SocketUtils API" 2019-03-07 03:54:22 +00:00
Remi NGUYEN VAN
b7bda39d90 Fix SocketUtils API
- connect, sendTo, bind were added as public API, so do not need to be
   maintained as SystemApi in SocketUtils. These APIs were added in Q
   timeframe.
 - Add @Nullable/@NonNull annotations.

Bug: 126699304
Bug: 126477266
Test: booted, WiFi works
Change-Id: I3f086ac8952cfd6a4d8f861d2e1c7aa1ca8be999
2019-03-06 18:02:34 +09:00
Chiachang Wang
f397b39442 Merge "Update description based on API feedback" 2019-03-06 00:49:20 +00:00
Chiachang Wang
4349dc08c9 Update description based on API feedback
Bug: 126883311
Test: Build pass
      atest NetworkStackTests
Change-Id: If3d21829bbe98d125215abe96247ca7d5a66d1f3
2019-03-05 20:31:57 +08:00
Remi NGUYEN VAN
5026c9ea28 Set module min_sdk_version to 28
The modules are not actually compatible with 28, but this is necessary
as tooling does not support "Q" as a version in the APK.

This will need to be changed to the new version number as soon as it is
available.

Test: m
Change-Id: I1d88f80c293b4667244d219a6989dd11be90f12a
2019-03-05 11:12:14 +09:00
Brett Chabot
8091d9e6d9 Migrate frameworks/base/tests/testables and its users to androidx.test
See go/jetpack-test-android-migration

Test: atest TestablesTests NetworkStackTests FrameworksServicesTests SystemUITests FrameworksUiServicesTests ExtServicesUnitTests
Exempt-From-Owner-Approval: already reviewed
Change-Id: I083fcdaa71b503535aa2b3c257740f3ecf055373
Merged-In: Ib04d80954bd8536914d88c66b28e6632e60a6245
2019-03-01 17:23:42 +00:00
Remi NGUYEN VAN
3e15c9f9ba Merge "Set NetworkStack targetSdk to 28" 2019-03-01 06:43:21 +00:00
Remi NGUYEN VAN
f4249c3885 Set NetworkStack targetSdk to 28
Test: flashed, booted, WiFi works
Change-Id: I7bbd7eb563432a290358d16652c0ae69e9772002
2019-03-01 11:42:50 +09:00
Baligh Uddin
222d1d04bf Merge "Set networking module APKs version to 10" 2019-02-28 15:54:28 +00:00
Remi NGUYEN VAN
4af3cdae16 Set networking module APKs version to 10
Up to now the version in output APKs was 28 (platform version by
default). This should make it easier to track and bump up the version.

Test: booted, WiFi works
Test: aapt dump badging shows version 10
Change-Id: I199eb55fd82e16ae748c8b011ce93cf48b505395
2019-02-28 11:28:50 +09:00
Chiachang Wang
95489ca49e Add more test case and some clean up
Bug: 120452078
Test: atest NetworkStackTests
Change-Id: Ifb981ccdaa7818bf2bebec98e91979007222910b
2019-02-26 11:32:18 +08:00
Chiachang Wang
2fd3ca6fa0 Merge "Injecting data stall event to statsd" 2019-02-22 05:12:42 +00:00
Chiachang Wang
f09e3e3043 Injecting data stall event to statsd
Bug: 121185319
Bug: 120452078
Test: - Build and test against data stall code
      - atest NetworkStackTests
Change-Id: I2ee16085e7861d38bcd203c98ffd682f86fdc867
2019-02-22 03:14:45 +00:00
Treehugger Robot
1d18e60e76 Merge "Consider 200 response with "Content-length <= 4" to not be a captive portal." 2019-02-20 11:14:24 +00:00
Xiao Ma
e7e5a35b38 Merge "Replace TcpSocketInfo with TcpKeepalivePacketDataParcelable in ApfTest." 2019-02-18 07:12:04 +00:00
Remi NGUYEN VAN
e4a40c77e1 Merge "Rename NetworkStack package" 2019-02-18 01:07:51 +00:00
Remi NGUYEN VAN
fd2d7dc685 Merge "Sign networkstack with its own certificate" 2019-02-16 01:48:49 +00:00
Remi NGUYEN VAN
3f23efdd13 Merge "Fix framework and NetworkStack classes conflicts" 2019-02-16 00:22:29 +00:00
Xiao Ma
6b4de8faf7 Replace TcpSocketInfo with TcpKeepalivePacketDataParcelable in ApfTest.
Test: atest NetworkStackTests
Change-Id: I95fde70c07b398a2a2f734f35165870284a3959c
2019-02-15 19:22:36 +09:00
Remi NGUYEN VAN
ab96bc758e Sign networkstack with its own certificate
The NetworkStack module is comprised of 2 updatable APKs
(NetworkStack.apk and CaptivePortalLogin.apk), and a stub APK to define
the signature permissions for the APKs (NetworkStackPermissionStub.apk).

Test: flashed, WiFi works, captive portal login works
Bug: 124033493
Change-Id: I772d1d63363a3eb6f817c21906498bd2385ab02b
2019-02-15 17:53:00 +09:00
Remi NGUYEN VAN
1b57e8e9db Fix framework and NetworkStack classes conflicts
Classes that are used in framework.jar cannot be linked in NetworkStack,
as the framework takes precedence in the classpath. This prevents the
networkstack from using these classes due to the hidden API usage
detection.

Do the following:
 - jarjar any shared source file between framework and NetworkStack, so
   the version in the NetworkStack uses a different package.
 - Move any shared class not used in the NetworkStack to services.net

The CL  uses jarjar on the app copy and not the framework classes, as
the framework cannot be updated without an OTA, and non-network stack
specific classes should not be renamed because of the network stack.

Test: atest FrameworksNetTests NetworkStackTests
Test: flashed svelte build, WiFi works
Bug: 124033493
Change-Id: I85d888b756adc28c36638913632bfdfdbf0e0486
2019-02-15 17:30:07 +09:00
Remi NGUYEN VAN
d989ed753d Merge "Add NetworkStackTests to device-tests suite" 2019-02-15 08:16:03 +00:00
Remi NGUYEN VAN
bfe928d593 Merge "Remove NetworkMonitor dependency on ICaptivePortal" 2019-02-15 08:09:29 +00:00
Xiao Ma
60e7162e05 Merge "Fix testApfFilterKeepaliveAck." 2019-02-15 04:04:32 +00:00
Dan Shi
b350df2941 Add NetworkStackTests to device-tests suite
It's needed for the test to run in a Test Mapping suite.

Bug: 123544631
Test: local build
Change-Id: I0678a3e8f9beed7c637c1b11594369aa5d3c87bf
2019-02-15 12:35:04 +09:00
Remi NGUYEN VAN
cfff01e2db Remove NetworkMonitor dependency on ICaptivePortal
ICaptivePortal is used in the framework and cannot be used as a
dependency in NetworkMonitor, as the framework class takes precedence
when linking.
Also fix NetworkMonitorTest that was not verifying the right
startCaptivePortalApp call.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 124033493
Change-Id: I8e7bb79e50650ae182a2e4277fb49abf5fb6d910
Merged-In: Ib6a89e54312628662b130fbeec18d11e139f09fa
2019-02-15 12:20:03 +09:00
Remi NGUYEN VAN
d36e3df7b0 Merge "Remove deps from framework on netd interfaces" 2019-02-15 03:11:31 +00:00
Xiao Ma
d36a89ccd6 Fix testApfFilterKeepaliveAck.
Apf program for TCP keep alive ACK also compares protocol field in IPv4
header and the total length of TCP keep alive ACK packet. Besides,
should set the ACK flag in the the TCP header of keep alive ACK packet.

Bug: 123992564
Test: atest NetworkStackTests
Change-Id: I997cd6807a33f7e1af25566226d803dcc2e257dd
2019-02-14 19:16:01 +09:00
Remi NGUYEN VAN
dacee147b4 Remove deps from framework on netd interfaces
If included in framework.jar, the interfaces conflict with any app that
needs to depend on them, including the NetworkStack.

Bug: 124033493
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I2db9f87b7154130726d4700b241d55b041635d98
Merged-In: I0ecae20d514bf888f3a80331f19369ceb1c52aa3
2019-02-14 17:26:59 +09:00
Chiachang Wang
a75c52c3df Merge "Use ServiceState to get data cell ID" 2019-02-14 07:24:16 +00:00
Hongshik
1da51fcdc4 Add "close" socket option for immediately close socket after finish check captive portal.
Unexpected packets are observed after captive portal check. Due to the packets, modem can't fall-back to idle state (modem remained as active state).
It makes unnecessary power consumtion.
To prevent it, "close" option is added in sendHttpProbe()

Test: check socket close.
Change-Id: I5b6987071ad915081846504adbb209eb371fd1c3
2019-02-14 10:51:51 +09:00
Chiachang Wang
7561071dfb Use ServiceState to get data cell ID
ServiceState now contains a CellIdentity that can be obtained
specifically from the data subscription, and for PS on cell
only.

This should be used for connectivity level network monitoring
info.

Bug: 123893112
Test: 1. atest NetworkMonitorTest
      2. Verify if cell id is correct

Change-Id: Ieb00de84a0d518e3197e3884f946b872e998304a
2019-02-14 09:30:58 +08:00
Remi NGUYEN VAN
749dfc3083 Merge "Remove INTERACT_ACROSS_USERS_FULL for NetworkStack" 2019-02-12 04:47:43 +00:00
Sehee Park
8e9a15bdbd Consider 200 response with "Content-length <= 4" to not be a captive portal.
There's no point in considering this a captive portal as the user cannot
sign-in to an empty page. Probably the result of a broken transparent proxy.

Bug: 122999481
Test: Manual

Change-Id: I1ca44092ac05a1708d9b41c5a4aad545b71b7eab
Signed-off-by: Sehee Park <sehee32.park@samsung.com>
2019-02-12 04:15:05 +00:00
Remi NGUYEN VAN
e765e8b7aa Merge "Remove hard-coded NetworkStack package name" 2019-02-12 03:58:09 +00:00
Remi NGUYEN VAN
8c0d94608c Rename NetworkStack package
Set the new name to com.android.networkstack. Also rename the stub APK
to com.android.networkstack.permissionstub.

Also add shared UID to the NetworkStackPermissionStub to enforce
signature restrictions on the UID.

Test: booted, WiFi working
Bug: 124033493
Change-Id: Id8967db08b7faaa659b20f86f1013493eb0e188f
2019-02-08 15:32:21 +09:00
Remi NGUYEN VAN
9c5d964902 Remove hard-coded NetworkStack package name
Have the network stack pass its package name in
showProvisioningNotification instead.

Bug: 124033493
Test: flashed, WiFi and captive portal works
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I1f3312768ba1fb34e99a827e1fcdaf7510e318a8
2019-02-08 12:12:57 +09:00
Remi NGUYEN VAN
f871bfb8c7 Remove INTERACT_ACROSS_USERS_FULL for NetworkStack
Replace with INTERACT_ACROSS_USERS, which is needed to send the
ACTION_NETWORK_CONDITIONS_MEASURED broadcast.

Also cleanup some non-privileged permissions that were added to the
priv-app file.

Test: built, booted, broadcast and captive portal login work
Bug: 123846255
Change-Id: I3c97c166e80c19bf57fa047709c8b91fca75d635
2019-02-07 02:39:57 +00:00
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