Commit graph

75,159 commits

Message SHA1
Add base classes for common ConnectivityService tests.
This sets up what is necessary for an instrumented
ConnectivityService to run. Users of this class are
meant to inherit CSTest.

This is still relatively basic and does not have all the
instrumentation in ConnectivityServiceTest. Developers
looking to extend CSTest may find some instrumentation
missing ; when they add the missing instrumentation,
they should consider whether it should be generic for all
CSTests (and put it in base/), or whether it's local to
their own test suite. This should enable faster testing
as each CSTest children will only need to set up the
instrumentation it actually needs.

This patch also migrates a basic test to have a first user.

Bug: 272685721
Test: ConnectivityServiceTest
      CSBasicMethodsTest
Change-Id: I1c47f616af90629c9cb2a6ae89d992b19863e704

Chalard Jean   commited 2023-09-11 16:46:27 +09:00
0f5c4fe9cb
Merge "Address review followup comments for NetworkStats" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-09-08 20:11:03 +00:00
8df4d76aa2
Merge "possibly fix clat ingress nat64 drop" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2023-09-08 18:28:28 +00:00
cc677b3116
possibly fix clat ingress nat64 drop
Due to try_make_writable's implementation:

  // try to make the 1st 'len' header bytes r/w via DPA
  void try_make_writable(struct __sk_buff* skb, int len) {
    if (len > skb->len) len = skb->len;
    if (skb->data_end - skb->data < len) bpf_skb_pull_data(skb, len);
  }

This *should* normally result in nothing actually being done.

This is because the 'len' we request should trivially be <= skb->len
(by virtue of how we construct the packet / get here),
and because skb->data_end - skb->data < len was previously
(to this patch) already checked below in line 251
(and thus the packet would have been dropped if it was false).

However, there's a tentative theory that we could somehow end up
with the entire payload in the non-linear portion of the packet,
and thus need to move it into the linear header portion where
we actually have direct packet access to it.

Note also that we already called this in line 71, so it should
be safe to add another call without causing bpf verifier unhappiness...

Test: TreeHugger
Bug: 298879031
Signed-off-by: Maciej Żenczykowski <maze@google.com
Change-Id: If3531c3cf6932ac3f1d384a43d28326d17544aa3

Maciej Żenczykowski   commited 2023-09-08 18:20:21 +00:00
66da6a9b44
Merge "Increase the timeout waiting for the test app's network status." into main
Sudheer Shanka   authored and   Gerrit Code Review   commited 2023-09-08 17:40:45 +00:00
f58fd8442d
Fix sorting in copy.bara.sky
Test: none
Change-Id: I0506ec660fd88e39079b2f36aed1516e27cdc0a6

Patrick Rohr   commited 2023-09-08 07:11:56 -07:00
371b709921
Merge "Add Chicken bit for the mDNS offload feature" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2023-09-08 13:25:53 +00:00
169de9c8a1
Merge "Disable cache flush bit in existing announcement" into main
Paul Hu   authored and   Gerrit Code Review   commited 2023-09-08 12:48:05 +00:00
af511b5abe
Merge changes Id390c6c5,Iaa00d4d3,Iba6f410c into main
* changes:
  Add third_party/google_benchmark to cronet's copybara
  Move buildtools/third_party/libc++[abi] to third_party in Cronet's copybara
  Cronet Import: Add jni_zero to the list of third_parties

Treehugger Robot   authored and   Gerrit Code Review   commited 2023-09-08 11:06:37 +00:00
dad74776b8
Merge "Remove unnecessary arguments from isTetheringFeatureEnabled" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-09-08 09:24:57 +00:00
656e42e16f
Add third_party/google_benchmark to cronet's copybara
Test: None
Change-Id: Id390c6c53f619b7bc87c80ae08acca9ee3a65c2e

Mohannad Farrag   commited 2023-09-08 09:23:25 +00:00
b16875a4d1
Move buildtools/third_party/libc++[abi] to third_party in Cronet's copybara
Test: None
Change-Id: Iaa00d4d383f84fbabe346cbe9a929ba471d68297

Mohannad Farrag   commited 2023-09-08 09:23:25 +00:00
c4daa59cd7
Cronet Import: Add jni_zero to the list of third_parties
Test: None
Change-Id: Iba6f410c23bdabbb5559772039b4242965e720a7

Mohannad Farrag   commited 2023-09-08 09:23:03 +00:00
eaba52172c
Add Chicken bit for the mDNS offload feature
Bug: 297482971
Test: TH
Change-Id: I6f2cdd066d9047b113ff80211cf6d4c6fa605104

Yuyang Huang   commited 2023-09-08 17:42:26 +09:00
b96a071f51
Merge "Add comments for framework-connectivity-t-mdns-standalone-build-sources" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2023-09-08 08:17:25 +00:00
29c616d76e
Remove unnecessary arguments from isTetheringFeatureEnabled
This CL also updates not to use isTetheringFeatureEnabled for
TETHER_FORCE_UPSTREAM_AUTOMATIC_VERSION which is wrongly configured in
Connectivity namespace.

Test: m
Bug: 279108992
Change-Id: If4f3a57c749bbaeb85454c31248c5bc5feaab936

Motomu Utsumi   commited 2023-09-08 16:11:28 +09:00
3e0be398a2
Increase the timeout waiting for the test app's network status.
Bug: 298729534
Test: atest com.android.cts.net.HostsideConnOnActivityStartTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:eaf030ea96f3af817e8b301c8edf48f79d7f229d)
Merged-In: I58a23e927cd14b973048e34566350eeef215f7db
Change-Id: I58a23e927cd14b973048e34566350eeef215f7db

Sudheer Shanka   authored and   Android Build Cherrypicker Worker   commited 2023-09-08 06:55:36 +00:00
0f53262c7b
Add comments for framework-connectivity-t-mdns-standalone-build-sources
framework-connectivity-t-mdns-standalone-build-sources should only be
used for building service-connectivity-mdns-standalone-build-test. Added
comment to prevent this filegroup being used in wrong way.

Test: TH
Change-Id: I11dd390967db1a115dcadcdebc20f226ab6c0a51

Yuyang Huang   commited 2023-09-08 14:51:08 +09:00
cf25a8a766
[nearby][clean up] Delete all Fast Pair AOSP and HalfSheetUX code
Test: -m
Fix: 292812342
Fix: 297413048
Fix: 214879640
Ignore-AOSP-First: merge conflicts, need to be merged in downstream first
Change-Id: I7efa92469f0c061a972a7dadf6a38686b78c61b4
Merged-In: I7efa92469f0c061a972a7dadf6a38686b78c61b4

Xinyi Zhou   commited 2023-09-07 16:03:09 -07:00
fcd2b7ccb0
Merge "Remove duplicated bpf offload support check in IpServer" into main
KH Shi   authored and   Gerrit Code Review   commited 2023-09-07 14:46:34 +00:00
966bb3e0d6
Verify that VPN name is set in VPN networks
Verify that the extra info for validation logs in the
NetworkInfo is set.

Bug: 297790570
Test: atest FrameworksNetTests
Change-Id: I5b77b3bab30154b7979cda003274cde0d834a5fb

Chiachang Wang   commited 2023-09-07 09:22:24 +00:00
5ee9dedb0f
Merge "Invoke setDataEnabled instead of setDataEnabledForReason on R device" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2023-09-07 01:36:58 +00:00
7145c5c1fe
remove TrafficController::dump
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I399ac8dfc4992f4c604f1d32c2f1b8ae06710808

Maciej Żenczykowski   commited 2023-09-06 16:50:06 +00:00
d70a33061e
Merge "cts: enforce cubic only on V+" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2023-09-06 16:07:11 +00:00
4f28615724
Merge "Convert ProcNetTest to JUnit4." into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2023-09-06 16:06:18 +00:00
7d2678c424
Merge "Fix lint errors in ProcNetTest." into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2023-09-06 16:04:35 +00:00
e491e563a9
Merge "BpfHandler: U requires 4.14+, V requires 4.19+" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2023-09-06 09:55:48 +00:00
0546394310
cts: enforce cubic only on V+
Test: TreeHugger
Bug: 291025434
Bug: 289802481
Bug: 294510745
Change-Id: I3c9646468834305e48c531040640e05f80b1c5e7

Maciej Żenczykowski   authored and   Lorenzo Colitti   commited 2023-09-06 17:15:54 +09:00
9fe823e34f
Convert ProcNetTest to JUnit4.
This allows using assumptions to skip tests.

Test: atest CtsHostsideNetworkTests
Change-Id: Ic1fc41c1ca0c30b6b7350c413d710d959b9a5013

Lorenzo Colitti   commited 2023-09-06 17:13:17 +09:00
9ae344b81a
Fix lint errors in ProcNetTest.
Test: test-only change
Change-Id: If3702cf9c3a36e3b7cb1853784f1a8ff98d7be07

Lorenzo Colitti   commited 2023-09-06 16:08:00 +09:00
ab5e0c98f0
Report more advertising metrics data
Report more advertising metrics data below when the service is
unregistered.
- Replied request count (sum across interfaces)
- Sent packet count (including announcements and probes)
- Number of conflicts during probing
- Nubmer of conflicts after probing

Bug: 287546772
Test: atest FrameworksNetTestCases NsdManagerTest
Merged-In: I50c54a35dc523422e3a7302c059bbbc38eac5631
Change-Id: I50c54a35dc523422e3a7302c059bbbc38eac5631

Paul Hu   commited 2023-09-06 11:26:53 +08:00
043bcd4537
Invoke setDataEnabled instead of setDataEnabledForReason on R device
There was no such method in R release, use SdkLevel to check
framework version and use different API accordingly.

Test: TH
Fix: 297768044
Change-Id: I357c0d56646ffd5eb018b6bb4efe47d4c48e71d3

Junyu Lai   commited 2023-09-06 10:52:18 +08:00
59ce1f1fcc
Merge "Send rawOffloadPacket to OffloadEngine" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2023-09-06 00:04:00 +00:00
a337d95cc4
Disable cache flush bit in existing announcement
Per RFC6762#10.1, the cache flush bit should be false for
existing announcement. Otherwise, the record will be deleted
immediately when receiving this response.

Bug: 299054783
Test: atest FrameworksNetTestCases NsdManagerTest
Change-Id: I8bf1a5b1914b49720862836abb543b232185f5f5

Paul Hu   commited 2023-09-05 17:54:55 +08:00
88239ccb0a
Merge "Delay frozen app sockets close until the cellular modem wakes up" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-09-05 09:11:01 +00:00
4e95ea0740
Send rawOffloadPacket to OffloadEngine
Add the missing logic to send the rawOffloadPacket to OffloadEngine.

Bug: 297314970
Test: atest CtsNetTestCases FrameworksNetTestCases
Change-Id: I06d7a9bb84df72808eff4f0c9df60f7e60aa2a2c

Yuyang Huang   commited 2023-09-05 08:51:04 +00:00
31f6e2eccb
Merge "Update permission check for offloadEngine registration" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2023-09-05 08:45:39 +00:00
65f96123a2
Merge "Send OffloadServiceInfos when registerOffloadEngine is called" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2023-09-05 07:05:05 +00:00
2be259b9cf
Update permission check for offloadEngine registration
For an app to register itself as an offloadEngine, it must have either
of the following permissions: NETWORK_STACK,
PERMISSION_MAINLINE_NETWORK_STACK, NETWORK_SETTINGS,
REGISTER_NSD_OFFLOAD_ENGINE.

Bug: 294777050
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: I19fe9b996a02b1ae23116c02a1b8406d93b3ecf1

Yuyang Huang   commited 2023-09-05 14:53:51 +09:00
8e6fbc8c1a
Merge "Factor out remoteauth dependencies to variables" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2023-09-05 04:22:06 +00:00
9bfa7ac0b9
Address review followup comments for NetworkStats
This change includes:
1. Mark groupedBy*() deprecated and throw after android U.
2. Modify map() to mapKeysNotNull().
3. rename clearInterfaces to withoutInterfaces and refactoring.
4. Modify tests accordingly.

Test: atest FrameworksNetTests:android.net.connectivity.android.net.NetworkStatsTest
Fix: 296149902
Fix: 296150018
Change-Id: I5d97422ba957a212c0c5fbc1eee3f8b174343348

Junyu Lai   commited 2023-09-04 18:01:14 +08:00
35c69c7986
Delay frozen app sockets close until the cellular modem wakes up
Closing TCP sockets sends RST packets. If the cellular modem is idle,
sending RST packets will wake the modem up and consume battery.

This CL adds delay_destroy_frozen_sockets_version flag.
When this flag and destroy_frozen_sockets_version is enabled,
ConnectivityService delays closing socket until the cellular modem wakes up.
Pending frozen sockets are closed also when cellular network becomes no
longer the default network.

This CL also adds flag status and pending uids to the dump.

Bug: 284900338
Test: FrameworksNetTests
Change-Id: I2562568390dda36d02f72afb3a96f824788964c0

Motomu Utsumi   commited 2023-09-04 18:04:31 +09:00
188bfd36da
Only use TEST_APK_NEXT starting from V
The Next app is only necessary in development branches and right now the
in-development SDK is V.

Test: TH
Change-Id: I6aa72d70bc124ae7cf40962b172965d1f0fdb437

Yuyang Huang   commited 2023-09-03 10:21:07 +00:00
04d1ce9ea2
BpfHandler: U requires 4.14+, V requires 4.19+
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I3f6440dfe3eb71fbe845eb70c0a6c53110f8d46f

Maciej Żenczykowski   commited 2023-09-01 21:07:15 +00:00
c2dd01c739
[nearby] Move NearbyIntegrationUntrustedTests and NearbyIntegrationPrivilegedTests from presubmit to postsubmit
The test runs for over 20min on several devices and we should move it to postsubmit.

Test: -m
Merged-In: Ie21c4ccece686896870c12486f55fe48840bdb1b
Change-Id: I4f5f8336bb8f952db062f927f79304df2f07cdeb

Xinyi Zhou   commited 2023-09-01 19:30:18 +00:00
72bbb446ef
Merge "Implement Discovery PLATFORM logic in Rust" into main
Igor Zaslavsky   authored and   Gerrit Code Review   commited 2023-09-01 16:28:34 +00:00
9cdea69732
Remove duplicated bpf offload support check in IpServer
In current code, IpServer will ensure bpf offload is supported before
calling BpfCoordinator's APIs. But those APIs already have the same
checks inside the function. This CL removed duplicated checks in
IpServer.

After this change, the BPF offload support status is only determined
inside BpfCoordinator and it won't change during the life cycle of
Tethering. Tethering initializes mBpfCoordinator just once in the
constructor. After that point, the value of isUsingBpf can never
change, because mIsBpfEnabled is final and
mBpfCoordinatorShim.isInitialized() is either always true (api30) or
can either never change (api31).

Also fixed a bug in IpServerTest upon this change.

Test: atest TetheringTests
Bug: 261923493
Change-Id: I50f231a83bf678b90eae4fd9bfa6035e86978bb3

KH Shi   commited 2023-09-01 07:37:18 +00:00
e4d549ab11
Merge changes Ib5f541ed,Iff6a3cb1,I2ebd5c7a into main
* changes:
  [remoteauth] Add UwbRangingSession
  [remoteauth] Implement RangingSession
  [remoteauth] Implement RangingManager

Jin Chen   authored and   Gerrit Code Review   commited 2023-08-31 23:02:08 +00:00
fafedb40c9
Implement Discovery PLATFORM logic in Rust
This commit changes implementation of Platform from async to callback
patternintr

Design doc: go/remote-auth-manager-fishfood-design

Test: built successfully.
Bug: : 291333048
Change-Id: I50d0297725dce3fc3b846c9fb059c2242adad746

Igor Zaslavsky   commited 2023-08-31 22:51:06 +00:00
2974a10216
Merge "Created empty framework-location non-updatable module" into main
Mark White   authored and   Gerrit Code Review   commited 2023-08-31 16:00:53 +00:00
e695330a89