Commit graph

42,953 commits

Message SHA1
Merge "Include suspended network when getAllNetworkStateSnapshots" am: 48426bb2a4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1797867

Change-Id: I700e16334e0f8aeea862555e8ecf784cf36fd315

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-09-09 09:40:15 +00:00
6f988d4042
Merge "Include suspended network when getAllNetworkStateSnapshots"
Junyu Lai   authored and   Gerrit Code Review   commited 2021-09-09 09:24:04 +00:00
48426bb2a4
Include suspended network when getAllNetworkStateSnapshots
Suspended network should be considered as temporary shortage of
connectivity of a connected network. Thus, it should not be
excluded from network state snapshots and causes data usage to
stop accounting or iptables rules to be removed on the interface
of the suspended network.

This change also address the naming confusion of default networks
parameter of expectNotifyNetworkStatus.

Test: atest ConnectivityServiceTest#testGetAllNetworkStateSnapshots
Bug: 196079981
Change-Id: I8096356f9a472fb1c1246fbdf3fd5f981387fb1c

Junyu Lai   commited 2021-09-08 06:02:28 +00:00
ddecb66246
Merge changes Id2ffb056,I2a4e298b am: 420fa2baef
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1772667

Change-Id: I84acbefcaf5cb95cc208d27caf8a89c0717db94e

Paul Hu   authored and   Automerger Merge Worker   commited 2021-09-07 06:13:41 +00:00
9477c7b5ca
Merge changes Id2ffb056,I2a4e298b
* changes:
  Adjust some behaviors on PermissionMonitorTest
  Use common code

Paul Hu   authored and   Gerrit Code Review   commited 2021-09-07 06:01:54 +00:00
420fa2baef
Merge "Remove a forgotten log" am: 3d872e662e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1803417

Change-Id: I5714b36c6f0f71887848aa8aa41697fca6c409aa

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-09-07 04:51:49 +00:00
3fe1865b96
Merge "Add debug logs to CaptivePortalTests" am: fe1a4f6e60
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1819792

Change-Id: I273364a1086077eb9aa355e1cce7b49e382aefbc

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-09-07 04:51:37 +00:00
84e05d9e98
Merge "Remove a forgotten log"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-09-07 04:37:23 +00:00
3d872e662e
Merge "Add debug logs to CaptivePortalTests"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-09-07 04:36:55 +00:00
fe1a4f6e60
Merge "Separate test into reasonable multiple tests" am: 26a7e61417
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1793478

Change-Id: I9193477c6744c6f9a1f7e7e14e0c98e4348b262d

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-09-07 03:01:39 +00:00
33076dddff
Merge "Separate test into reasonable multiple tests"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-09-07 02:40:13 +00:00
26a7e61417
Adjust some behaviors on PermissionMonitorTest
- This is a test only change.
- Remove calling startMonitoring() in setup() because this method
  should be called only once, so each test needs to call
  startMonitoring() if the testing function is running on it.
- Return empty list instead of null when getting installed
  pacakges in setup(). This can help test to have default user
  MOCK_USER1 when they call startMonitoring().

Bug: 192431153
Test: atests FrameworksNetTests
Change-Id: Id2ffb056b378873c3ba6a8bb31b7dedb56ad6d46

paulhu   commited 2021-09-07 09:46:23 +08:00
941fa70744
Merge "Correct uid to app id for netd traffic permission methods" am: 9fe8c8fc76
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1767733

Change-Id: I11d1e21c7510c5f2d07198d8930134c6a9976708

Paul Hu   authored and   Automerger Merge Worker   commited 2021-09-07 01:26:18 +00:00
2fe543353b
Use common code
- Some code are used many times, it's better to make them as
  common code for reducing inconsist behavior.
- Also stop using Boolean to represent network permissions and
  replace them with int value. Because using Boolean for
  permission comparison is really complicated and bizarre.
- Use PERMISSION_* for netd network permission directly.

Bug: 189705071
Test: atests FrameworksNetTests
Change-Id: I2a4e298b9a01f4b2874ae68e9d9539a0ab4aff4c

paulhu   commited 2021-09-07 09:25:31 +08:00
b7dd7a3f4b
Merge "Correct uid to app id for netd traffic permission methods"
Paul Hu   authored and   Gerrit Code Review   commited 2021-09-07 01:13:56 +00:00
9fe8c8fc76
Merge "Reduce duplicated code" am: 1d04d8362f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1767727

Change-Id: I7612eb48c780c94b47f4741eb85b91b3cdf0a44f

Paul Hu   authored and   Automerger Merge Worker   commited 2021-09-06 16:33:38 +00:00
f74a08823e
Merge "Reduce duplicated code"
Paul Hu   authored and   Gerrit Code Review   commited 2021-09-06 16:17:45 +00:00
1d04d8362f
Add debug logs to CaptivePortalTests
The point is to help with debugging flakes of this test by
clarifying the timing of these calls with respect to when
NetworkMonitor reads the settings and the values it obtains.

Test: CaptivePortalTest
Change-Id: I29ac1d8cff1f96c91be2459e9a8f34f8ba1f38e3

Chalard Jean   commited 2021-09-06 18:08:45 +09:00
d0d5c64bab
Correct uid to app id for netd traffic permission methods
Some uids should be app ids, correct them for avoiding confusion
and incorrect use.

Bug: 189705071
Test: atests FrameworksNetTests
Change-Id: I4a5930e5dc63b4d901e1567f8935ad7203866c89

paulhu   commited 2021-09-06 00:12:23 +08:00
1d4ec79020
Reduce duplicated code
- This is a test only change.
- Some methods are very similar and duplicated. So merge them to
  improve readability and reduce code complexity.
- Stop spying PermissionMonitor.

Bug: 189705071
Test: atests FrameworksNetTests
Change-Id: I8ec17bd2d396c4d49dd8b64be85d89d0145f4c3c

paulhu   commited 2021-09-03 15:58:15 +08:00
7a29739f2f
Merge "Remove unused libbacktrace library." am: f7e6b7f424
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1807719

Change-Id: I7781fb81bfe78760334c5cc9301da505b9202d8b

Christopher Ferris   authored and   Automerger Merge Worker   commited 2021-09-02 21:38:38 +00:00
341de04dee
Merge "Remove unused libbacktrace library."
Christopher Ferris   authored and   Gerrit Code Review   commited 2021-09-02 21:25:02 +00:00
f7e6b7f424
Merge "Replace inexact alarm setRepeasting with setExact alarm" am: 507de1cac6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1793479

Change-Id: Ia989bed2395130329ce5946cb7ece91089fc8571

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-08-30 14:01:49 +00:00
096498601e
Merge "Replace inexact alarm setRepeasting with setExact alarm"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-08-30 13:42:25 +00:00
507de1cac6
Refactor the offload permission check and add tests am: b344870ea0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1803422

Change-Id: I857de882e6f613d3bf57d271532f761be10bf988

Hungming Chen   authored and   Automerger Merge Worker   commited 2021-08-27 05:02:15 +00:00
5dbbd2f132
Refactor the offload permission check and add tests
- Rename the conntrack destination port check function
- Use CollectionUtils.contains to check the denied ports
- Add tests for the streams with ftp and pptp tcp port are
  not able to be offloaded

Bug: 195914327
Test: atest TetheringCoverageTests
Change-Id: I7e2591bea1f6db46271efb0c30970fb8d4efe1e4

Hungming Chen   commited 2021-08-26 21:21:05 +08:00
b344870ea0
Merge "Fix IpSecAlgorithmTest on S" am: 0084591e94
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1806806

Change-Id: I152aaf741e474f9cf6d39a86be9ff4800a83b1b4

Orion Hodson   authored and   Automerger Merge Worker   commited 2021-08-26 07:59:21 +00:00
89213602ee
Merge "Fix IpSecAlgorithmTest on S"
Orion Hodson   authored and   Gerrit Code Review   commited 2021-08-26 07:47:33 +00:00
0084591e94
Fix IpSecAlgorithmTest on S
The test may be run on S builds older than itself, in which case the
resource ID may not match. Query the resource ID dynamically instead of
using the constant.

IpSecAlgorithm is not updatable in S, which is why it can use
hidden/unstable platform resources, so the test could also be skipped
altogether on S. But considering that keeping it around is not very
costly yet, this change fixes it for running on S.

Bug: 197489543
Test: atest IpSecAlgorithmTest
Change-Id: I533eede3a360a8db9089e65e017b9d7453b35539

Remi NGUYEN VAN   commited 2021-08-25 18:10:22 +09:00
ae7508f9b5
Merge "Tethering/bpf_progs/offload - replace all TC_ACT_OK with TC_ACT_PIPE" am: dc8388ca08
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1807971

Change-Id: Iad650917305d67b799d059e4b285af5fd3f54709

Maciej Ĺ»enczykowski   authored and   Automerger Merge Worker   commited 2021-08-25 07:37:55 +00:00
e953144055
Merge "Tethering/bpf_progs/offload - replace all TC_ACT_OK with TC_ACT_PIPE"
Maciej Ĺ»enczykowski   authored and   Gerrit Code Review   commited 2021-08-25 07:19:28 +00:00
dc8388ca08
Remove a forgotten log
Test: ConnectivityServiceTest
Change-Id: Idc3b91422263bf5d062ee1682f41fc28616376b6

Chalard Jean   commited 2021-08-25 13:19:04 +09:00
1347844336
Tethering/bpf_progs/offload - replace all TC_ACT_OK with TC_ACT_PIPE
The correct return code to keep on processing any further TC
attached programs is 'TC_ACT_PIPE' and not 'TC_ACT_OK' (which
is terminal).

Without this the ipv6 tether offload program causes termination
of processing and the ipv6 clatd offload program never actually
handles any packets (while tethering is active).

This results in lack of bpf xlat64 offloading for tethered ipv4
traffic on an ipv6-only (cellular) network.

This in turn means incoming TCP packets get GRO'ed, do not get
bpf offloaded, and get delivered to the clat daemon, which
due to them being bigger than the mtu (due to gro) cannot
handle them and discards them.

This results in poor performance, since tcp falls back to 1 mss/mtu
sized packet per rtt.

Tested via tethering a linux laptop on an ipv6-only cellular connection
and downloading the linux kernel from kernel.org via 'wget -6' and 'wget -4'.
Before:
  IPv6: over 2MB/s, observed:
    5805 packets, including 4 sackOK
  IPv4: under 1MB/s, observed:
    9300 packets, including 8 sackOK, 387 sack 1, 501 sack 2, 2310 sack 3
After:
  IPv6: over 7MB/s, observed:
    16702 packets, including 4 sackOK
  IPv4: over 9MB/s, observed:
    32755 packets, including 2 sackOK

Test: builds, TreeHugger, see above
Bug: 195624908
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I623dacb5a37dc689cea34499c3906c11fcaf946c

Maciej Ĺ»enczykowski   commited 2021-08-24 23:24:19 +00:00
6e66a36367
Remove unused libbacktrace library.
Bug: 120606663

Test: Builds.
Change-Id: I733defd03670b01a30c4be5742498d62db7a9b6b

Christopher Ferris   commited 2021-08-24 15:57:29 -07:00
2b63a2f92a
Give EthernetTetheringTest the restricted networks permission. am: 8fbadf4ac5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1807157

Change-Id: I13defb1e00586393e91ca19100cf437482a64090

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-08-24 08:54:53 +00:00
c1256c4cf3
Give EthernetTetheringTest the restricted networks permission.
This test fails on devices where physical Ethernet interfaces are
available but marked restricted, like cuttlefish.

Bug: 197462993
Test: test-only change
Change-Id: I15c991b2e43e2d5e823dcdcfbd74adfd9b2f6f08

Lorenzo Colitti   commited 2021-08-24 15:18:54 +09:00
8fbadf4ac5
Merge "Fix an infinite loop with network offers" am: 77992bbfbb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1800007

Change-Id: I1fe463232308fbc73753dc8d19f269142f6f8776

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-08-20 06:39:30 +00:00
72ed43d6dc
Merge "Fix an infinite loop with network offers"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-08-20 06:17:31 +00:00
77992bbfbb
Merge "bpf: don't offload IPv4 packets with TCP port 21 (ftp) and 1723 (pptp)" am: ad8fb7fce4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1802476

Change-Id: I2ca694a0154b3043092890cfd272e7b86cca3fb5

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-08-20 03:39:28 +00:00
b6ea38e832
Merge "bpf: don't offload IPv4 packets with TCP port 21 (ftp) and 1723 (pptp)"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2021-08-20 03:24:09 +00:00
ad8fb7fce4
bpf: don't offload IPv4 packets with TCP port 21 (ftp) and 1723 (pptp)
Bypass the IPv4 TCP packets with port 21 (ftp) and 1723 (pptp) from
BPF offload because these packets need the netfilter conntrack helper.

Bug: 195914327
Test: manual test as the follows
1. Connect to ftp.slackware.com with port 21 in active mode.
2. Check the PORT command success.
   Command:  PORT 192,168,62,128,174,17
   Response: 200 PORT command successful.
3. Download a file.

Change-Id: I8e3b8d9323eb0e572f20c74442b55d4ee95abc2f

Hungming Chen   authored and   Nucca Chen   commited 2021-08-19 14:29:25 +00:00
bc85178435
Fix an infinite loop with network offers
When the avoidBadWifi configuration is false and not overridden,
a WiFi network that was validated in the past but becomes
unvalidated needs to outscore a cell network that is validated.
This is happening correctly when the stack compares two networks.
However, when the stack compares an existing network to an offer
for a cellular network, the offer was automatically considered
not to yield. This would mean the stack would be requesting cell
out of the telephony factory, only for that network to lose to
WiFi and be discarded immediately, then recreated again etc.

When there is some other reason cell should be up (such as the
"mobile always on" setting being active), this would not be
visible because the cell network would have another reason not
to be torn down.

Have offers correctly account for the current value of the
configuration and setting. This has the ranking of the offer
lose against WiFi like the actual network loses, meaning the
offer is not needed.

This also requires updating the offers whenever the value of
the setting changes.

Test: new test for this, also ConnectivityServiceTest
Bug: 195441367
Change-Id: I4fe5de98bc15bcf9bbbe25c6c7c8a7ba382f8db7

Chalard Jean   commited 2021-08-19 22:53:41 +09:00
bb902a5fee
Merge "Bypass cellular battery stats test if telephony is not supported" am: 1c603e7ec3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1796589

Change-Id: I2e10702cee72d81da0564fb29f5fcddc465775c9

Aaron Huang   authored and   Automerger Merge Worker   commited 2021-08-19 05:54:28 +00:00
d347dad799
Merge "Bypass cellular battery stats test if telephony is not supported"
Aaron Huang   authored and   Gerrit Code Review   commited 2021-08-19 05:37:59 +00:00
1c603e7ec3
[automerger skipped] Merge "Skip wifi stats test if link layer stats is not supported" am: cf79fcba3b -s ours
am skip reason: Merged-In I592dd5f1d6e13b020beadb11b9d913857a82e524 with SHA-1 58b493abf6 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1796372

Change-Id: Ie00207c8598911d6d4af814909bbd74ff209edc2

Aaron Huang   authored and   Automerger Merge Worker   commited 2021-08-19 03:36:54 +00:00
171905cb5f
Merge "Skip wifi stats test if link layer stats is not supported"
Aaron Huang   authored and   Gerrit Code Review   commited 2021-08-19 03:23:22 +00:00
cf79fcba3b
Merge "Merge sc-dev-plus-aosp-without-vendor@7634622" into stage-aosp-master
Xin Li   authored and   Android (Google) Code Review   commited 2021-08-17 18:15:09 +00:00
e534ce4c55
Separate test into reasonable multiple tests
The test actually verifies multiple behaviors and mutates the
networkCapabilities. Thus, refactor the method to keep the
tests easier to follow up.

Bug: 191918212
Test: atest android.net.NetworkCapabilitiesTest
Change-Id: Ibad1a0569d26d92f94153bee323cef5a1c30d8d4

Chiachang Wang   commited 2021-08-17 16:02:09 +08:00
d525a64ead
Bypass cellular battery stats test if telephony is not supported
This test requires a cell network so the test will be failed if
the device does not support telephony. Add a condition to check
if the device supports telephony and skip cellular battery stats
test if telephony is not supported.

Bug: 196231205
Test: atest CtsNetTestCases:BatteryStatsManagerTest
Change-Id: I9ddc1da2a3f83f3fd2ab59059185f2f7a8d08701

Aaron Huang   commited 2021-08-17 07:13:16 +00:00
1e49ed0e84
Skip wifi stats test if link layer stats is not supported
Wifi link layer is an optional feature so this test will be
failed on wifi stats check if a device does not support it.
Add a check to know if the  device supports wifi link layer
stats and skip it if it is not supported.

Bug: 195518957
Test: CtsNetTestCases:BatteryStatsManagerTest
Change-Id: I592dd5f1d6e13b020beadb11b9d913857a82e524
Merged-In: I592dd5f1d6e13b020beadb11b9d913857a82e524

Aaron Huang   commited 2021-08-17 07:12:54 +00:00
114a5b2fd3