Commit Graph

8081 Commits

Author SHA1 Message Date
lesl
6a953ef4d3 wifi: Add bridged pre-fix for tethering interface
In bridged mode, the tethered interface will include the prefix ap_br_

Bug: 162686273
Test: Manual Test - bridged AP enabled success
and client can connected it and get the IP address
Test: atest -c NetworkStackTests
Test: atest -c FrameworksNetTests
Test: atest -c CtsNetTestCasesLatestSdk
Change-Id: I89ae178c658a42f902199afaed89ec798de54643
2021-01-18 01:21:32 +00:00
Sudheer Shanka
edb6669cf1 Merge "Increase the wait timeout for meteredness to change." 2021-01-07 22:56:48 +00:00
Treehugger Robot
4f430ae5ec Merge "Revert "Add service-connectivity to tethering APEX"" 2021-01-07 15:25:03 +00:00
Pete Bentley
850ca6f6b4 Revert "Add service-connectivity to tethering APEX"
Revert "Set setCurrentProxyScriptUrl as public"

Revert submission 1532910-connectivity_jar_in_apex

Reason for revert: Breaks boot tests: b/176969905
Reverted Changes:
Ie41a5b569:Set setCurrentProxyScriptUrl as public
Id7b6a4664:Move service-connectivity to the tethering APEX
Ia7cb83834:Add service-connectivity to tethering APEX

Change-Id: I9f31d4810a92e620f02cc8d24bdf18fe28001a2b
2021-01-07 13:51:18 +00:00
Lorenzo Colitti
7998551cdc Merge "Add service-connectivity to tethering APEX" 2021-01-07 08:34:25 +00:00
Remi NGUYEN VAN
bd5cc4231d Add service-connectivity to tethering APEX
Add the connectivity service JAR to the tethering APEX.
This change should not be released in monthly updates until the
modularization work is done, so will be reverted in module release
branches.

Test: Boot, wifi connects and has internet access
Bug: 171540887
Merged-In: Ic496cd62be8c90928ccc619519ebe517beea78f0

Change-Id: Ia7cb83834b854e8c495c4ef17ec69ad032509208
2021-01-07 06:17:33 +00:00
Lorenzo Colitti
c9c51b665d Merge "Migrate away from AsyncChannel in NetworkAgent" 2021-01-06 14:10:21 +00:00
Sudheer Shanka
796f29c09e Increase the wait timeout for meteredness to change.
Bug: 170241174
Bug: 174808291
Test: atest CtsHostsideNetworkTests:HostsideRestrictBackgroundNetworkTests
Change-Id: I3af17819a403958d88a30af7f6346e5bb96b2828
2021-01-05 06:37:56 +00:00
Chalard Jean
4f896db6ff Migrate away from AsyncChannel in NetworkAgent
Use two oneway binder interfaces instead.
The interfaces post messages to handlers as was implemented before, but
provide a more strictly defined interface, with less hops between
NetworkAgent, AsyncChannel, and ConnectivityService.

Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Merged-In: Ica51d0179bcb3b4e314d2c3e85709aead6ca5657

Change-Id: Ica51d0179bcb3b4e314d2c3e85709aead6ca5657
2020-12-25 11:11:32 +09:00
Treehugger Robot
561f38a799 Merge "Also update connected clients for local only tethering" 2020-12-23 11:36:34 +00:00
markchien
f50f05ebcb Also update connected clients for local only tethering
mForwardedDownstreams is the set of downstreams who wanted upstream.
In other word, it don't contains localOnly tethering(e.g. local only
hotspot, wifi p2p tethering). Changing the list from mForwardedDownstreams
to mNotifyList make both tethered and localOnly tethering have connected
clients callback.

Bug: 172290164
Test: atest TetheringTests
Change-Id: I58fdb28efc616b00d63a1c237ea93aee4d8f2dcd
2020-12-22 23:23:09 +08:00
Chalard Jean
fab11bb263 Merge "Move module utils to the module package." 2020-12-21 05:35:09 +00:00
Remi NGUYEN VAN
abb46bef36 Fix timeout on NetworkAgentTest callback
All callbacks in the class use the DEFAULT_TIMEOUT_MS, except for this recently
added test.

The test is currently flaky in various branches.
Fixes: 174716714
Fixes: 174691729
Change-Id: I9f4446bb83eb4402c912292ac31d46e1d2cb6a52
Test: TH
2020-12-16 06:29:20 +00:00
Chalard Jean
d2df5729f6 Move module utils to the module package.
Test: FrameworksWifiTest FrameworksNetTest
Merged-In: Ib04bebb061dc64d6d685116b596fb3179d5b959a
Change-Id: I9118da3898d864c7bf0ed7bc9d94b94343c4a084
2020-12-16 11:44:34 +09:00
Remi NGUYEN VAN
9b6b353b5d Move cts/net/TEST_MAPPING to toplevel
The tests should just be run on any change in packages/modules/Connectivity,
not just changes in the CTS package.

Change-Id: I1c86c402f39a8a9b84e7422445df289c3ea7842f
Test: TEST_MAPPING needs to be verified by TH
2020-12-15 09:39:58 +00:00
Orion Hodson
b5e3c63b72 Merge "Use libnetjniutils for JNI File Descriptor info" 2020-12-15 06:25:38 +00:00
Lorenzo Colitti
678d27faca Merge changes from topic "cs-generalize-underlying-networks"
* changes:
  Update NetworkAgentTest to support generalized underlying networks.
  Minor fixes to NetworkAgentTest.
2020-12-14 05:19:49 +00:00
Lorenzo Colitti
ed1211d2d8 Update NetworkAgentTest to support generalized underlying networks.
Currently, when an agent calls setUnderlyingNetworks, the
transports of the network are hardcoded to TRANSPORT_VPN only.
This is being fixed in another CL in this topic. The new code
reports the same transports sent by the agent.

This test registers an agent with TRANSPORT_TEST|TRANSPORT_VPN.
Update the test to expect both transports in the callbacks it
receives.

Bug: 173331190
Test: passes when run with other CL in topic
Change-Id: Iede61d74fa02a4fec1f345f6d18835c1acab7337
2020-12-12 22:57:06 +09:00
Lorenzo Colitti
cc3e994f16 Minor fixes to NetworkAgentTest.
- Use a more realistic routing config (instead of a LinkAddress
  with prefix length 0, an address with a mask of 32 and a
  default route).
- Use InetAddresses to parse IP addresses since it's a public API.
- Import the NET_CAPABILITY_xxx and TRANSPORT_xxx constants for
  readability.

Bug: 173331190
Test: test-only change
Change-Id: I9703d7dd5781f60fb3d531267d3f5370cbccd64f
2020-12-12 22:57:05 +09:00
Orion Hodson
e5bd0dba21 Use libnetjniutils for JNI File Descriptor info
Drops use of deprecated API in libnativehelper and uses a common
helper that will be stable across releases.

Bug: 158749603
Test: m
Change-Id: Ic1a1811ffb9a1c207f562a180417e99df31e3502
2020-12-11 22:48:10 +00:00
Lorenzo Colitti
78f7c04770 Merge "Pass in proper NetworkCapabilities in testSetUnderlyingNetworks." 2020-12-09 00:11:23 +00:00
Lorenzo Colitti
977464ef5a Pass in proper NetworkCapabilities in testSetUnderlyingNetworks.
The CL that introduced testSetUnderlyingNetworks allowed tests to
pass in NetworkCapabilities when registering an agent, but
incorrectly always set the agent's capabilities anyway. This
resulted in testSetUnderlyingNetworks registering an agent with
TRANSPORT_VPN and NET_CAPABILITY_NOT_VPN.

Fix this by ensuring that createNetworkAgent either uses the
passed-in capabilities unmodified, or creates its own. Assert
that the test VPN network does not have NET_CAPABILITY_NOT_VPN.

While I'm at it, remove the manual unregistration of the callback
by using the registerNetworkCallback helper method.

Also add a little bit of extra test coverage.

Bug: 173331190
Test: test-only change
Change-Id: I114d876a1b2bf5344dd7c6fa23862df1c0a412c3
2020-12-08 01:15:32 +09:00
Remi NGUYEN VAN
7fc54e7294 Set noparent in connectivity CTS owners am: d01761e07f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1516266

Change-Id: I7e6e9d5cbf2ac3d22bcfde2faeeac4ac0b61ec4f
2020-12-03 10:11:05 +00:00
Remi NGUYEN VAN
d01761e07f Set noparent in connectivity CTS owners
Also reorganize the files to have one toplevel CTS owners file, and only
additional owners in subdirectories.

Change-Id: I28ce193896e1ade2034589327805870774a4d608
Test: m
2020-12-03 08:07:32 +00:00
Lorenzo Colitti
6bd26a9f30 Merge "Add a CTS test for NetworkAgent#setUnderlyingNetworks." am: 7d04b2a26c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1511114

Change-Id: I27f049c42e03d5ce4958ab3f94346c57f858db86
2020-11-28 03:20:41 +00:00
Lorenzo Colitti
7d04b2a26c Merge "Add a CTS test for NetworkAgent#setUnderlyingNetworks." 2020-11-28 02:49:53 +00:00
Lorenzo Colitti
7b4b6f40a8 Merge changes I82811a97,Ic508b17e,I23ca7980 am: e74700dd5d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1512851

Change-Id: I480d4d7cea8d6009ef71e0bf30f6d7a18dd99783
2020-11-27 10:44:42 +00:00
Treehugger Robot
59ecc20061 Merge "Fix race condition in NetworkWatchListTest" am: de39ae42ac
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1511070

Change-Id: I14fa977efaf51d591409a8a4c2c547bba7d8bed1
2020-11-27 10:44:33 +00:00
Lorenzo Colitti
e74700dd5d Merge changes I82811a97,Ic508b17e,I23ca7980
* changes:
  Add OWNERS for packages/modules/Connectivity.
  Add repo hooks for packages/modules/Connectivity.
  Add a .gitignore in packages/modules/Connectivity.
2020-11-27 10:33:30 +00:00
Treehugger Robot
de39ae42ac Merge "Fix race condition in NetworkWatchListTest" 2020-11-27 10:12:05 +00:00
Lorenzo Colitti
3657ce9cda Add a CTS test for NetworkAgent#setUnderlyingNetworks.
Bug: 173331190
Test: atest CtsNetTestCases:NetworkAgentTest#testSetUnderlyingNetworks
Change-Id: I442a618d2d50eb15dbcb8926b60fc6fd0d5b2f3e
2020-11-27 18:09:24 +09:00
Lorenzo Colitti
99fcd0bbf8 Add OWNERS for packages/modules/Connectivity.
Specify the owners here instead of including them from other
places (e.g., frameworks/base, NetworkStack) because we hope that
this project will eventually contain all the code.

Test: none
Change-Id: I82811a9758480f16654145c4d55ef784be09de2b
2020-11-27 18:09:24 +09:00
Lorenzo Colitti
a7d3c79a76 Add repo hooks for packages/modules/Connectivity.
This adds the Java and Kotlin linters.

Test: repo upload
Change-Id: Ic508b17ed0b4e33c41debbbeb7a6c0406c46a973
2020-11-27 18:09:24 +09:00
Lorenzo Colitti
1fb77ae003 Add a .gitignore in packages/modules/Connectivity.
Test: None
Change-Id: I23ca7980db01b3f32e94876fa9a0b3952cf29914
2020-11-27 18:09:21 +09:00
Remi NGUYEN VAN
9d29736aea Merge "Add TEST_MAPPING config for CTS postsubmit" am: d4430d28ba
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1509694

Change-Id: Id6c5b6d1150a0c30a55cbaafc7cdbcad56263bb3
2020-11-27 08:56:54 +00:00
Remi NGUYEN VAN
d4430d28ba Merge "Add TEST_MAPPING config for CTS postsubmit" 2020-11-27 08:42:31 +00:00
Alan Stokes
36529b250a Fix race condition in NetworkWatchListTest
We were running cp to create a file and then running a command to read
the file. However were weren't waiting for the cp to finish (or,
indeed, start), so occasionally the read would fail saying the file
didn't exist.

Also added some logging, because diagnosing failure without it is
painful. Also simplify & improve file closing logic.

Some of this was previously submitted on internal master as change
I1c875102f0cce32cbbe2e3b36de913741c9abb92, but I've reverted that in
favor of this.

Bug: 168216494
Test: atest CtsNetTestCases:android.net.cts.NetworkWatchlistTest
Change-Id: I46a9db8b7a1885a9829f00bbd3233b863cfd1f5d
2020-11-26 14:27:39 +00:00
Treehugger Robot
8f501fea9c Merge "Tune up TIMEOUTs of IPSec CTS for low end devices" am: 1de9621925
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1498276

Change-Id: I0c22f28721ee625c86912459a14860b6d6a859ea
2020-11-25 20:23:12 +00:00
Treehugger Robot
1de9621925 Merge "Tune up TIMEOUTs of IPSec CTS for low end devices" 2020-11-25 19:56:50 +00:00
Remi NGUYEN VAN
1bc6287249 Add TEST_MAPPING config for CTS postsubmit
The new configuration runs tests on physical devices with SIM cards.
This is only done in postsubmit, as such tests can only run a few (~2) times a day due to
availability of the devices.

This configuration allows running all tests, so there is no annotation filter.

Change-Id: If95e4deeed8098327023f99e6e610331b8e86a0f
Test: TH validates TEST_MAPPING configurations
2020-11-25 18:27:48 +08:00
Junyu Lai
3e5a3ed5d5 Merge changes from topic "TrafficStats.getTxRxBytes" am: 42fbb57b31
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1490181

Change-Id: I93a1a017b55c30ba08da434a05c1335719ffcbcd
2020-11-25 04:14:47 +00:00
junyulai
34fe3e48e4 Add CTS for getTx/RxBytes in TrafficStats am: 549cc56731
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1490180

Change-Id: Id02aa1ab9038287da16594d513368935408ed8c5
2020-11-25 04:14:46 +00:00
Junyu Lai
42fbb57b31 Merge changes from topic "TrafficStats.getTxRxBytes"
* changes:
  Exclude lingering traffic from loopback iface stats check
  Add CTS for getTx/RxBytes in TrafficStats
2020-11-25 02:35:20 +00:00
Chalard Jean
a56ea8445c Merge "This bug was fixed in S, don't test for it in R" am: d639d12161
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1505171

Change-Id: I80515e22a2434f5deb6001d77c7cad79d9f92615
2020-11-24 09:51:51 +00:00
Chalard Jean
d639d12161 Merge "This bug was fixed in S, don't test for it in R" 2020-11-24 07:01:57 +00:00
Chalard Jean
e90c48c9aa This bug was fixed in S, don't test for it in R
Bug: 172401665
Test: CtsNetTestCasesLatestSdk
Change-Id: Ib9fb3ec09eeaebbb4ac1b1b458cfcc5c4f506cff
2020-11-20 17:54:26 +09:00
Cody Kesting
38cda37e44 Merge "Use READ_PHONE_STATE when checking Carrier Configs." am: b9e51da2e8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1489639

Change-Id: I84dedf9b3ff80d837f7b1fcd4a608e45db6afa00
2020-11-17 18:39:43 +00:00
Cody Kesting
b9e51da2e8 Merge "Use READ_PHONE_STATE when checking Carrier Configs." 2020-11-17 17:54:09 +00:00
Yintang Gu
5c39147e5a Tune up TIMEOUTs of IPSec CTS for low end devices
Ikev2VpnTest#testStartStopVpnProfileV4 and testStartStopVpnProfileV6
contains the IKE sequences and requires the phone to send and receive
the required packet in 1000ms.
On some low end devices, the response time may exceeds this TIMEOUT
sometimes.
So we need to use larger timeouts.

Bug: 171176723
Change-Id: I005b83ffecd8ade5063000690bfd4136d82f1a07
2020-11-13 10:43:31 +08:00
Treehugger Robot
107b0a0745 Merge "Add an owner for NetworkWatchlistTest." am: 4eda64baca
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1492980

Change-Id: Icbadae3abb93626916d0d5533d515767e424a9b8
2020-11-12 13:31:55 +00:00