Commit graph

109,133 commits

Message SHA1
Add method to get socket cookie from socket FileDescriptor
aosp/3502915 use this method from ConnectivityService to get socket
cookie that is required for closing QUIC connection.

Bug: 311792075
Test: m, boot
Change-Id: I17d8a4dd24cfb84e9b008b8eb87eedec67b29020

Motomu Utsumi   authored and   Maciej Żenczykowski   commited 2025-03-03 17:23:04 -08:00
b9b8828bf5
Merge "[Thread] In Integration test, let the DNS client wait for DNS server to show up in Network Data" into main
Handa Wang   authored and   Gerrit Code Review   commited 2025-02-26 17:45:38 -08:00
1cfc7f69ef
Merge changes If35a4b83,Ibe52ccd9 into main
* changes:
  Enable Bluetooth before running testReserveL2capNetwork
  Reverse pollingCheck arguments to be more kotlin friendly

Treehugger Robot   authored and   Gerrit Code Review   commited 2025-02-26 15:28:08 -08:00
3e93861b3d
Merge "Revert "Allow collecting diagnostics from shell commands"" into main
Liana Kazanova (xWF)   authored and   Gerrit Code Review   commited 2025-02-26 14:01:50 -08:00
f6f81012a6
Enable Bluetooth before running testReserveL2capNetwork
Bug: 397740298
Test: TH
Change-Id: If35a4b83ab8f96d0c98b3bf2ecb8b0e68420c4fe

Patrick Rohr   commited 2025-02-26 13:50:06 -08:00
d1cca845e2
Revert "Allow collecting diagnostics from shell commands"
This reverts commit 47b6619fa8.

Reason for revert: DroidMonitor: Potential culprit for http://b/399299587 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: Id7717258b960ac18a27575fdc2b0852b42ef4e7b

Liana Kazanova (xWF)   authored and   Gerrit Code Review   commited 2025-02-26 12:20:26 -08:00
3eec0163fc
Merge "Revert "Add SkipNativeNetworkCreation flag in NetworkAgentConfig"" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-02-26 03:02:34 -08:00
689297411a
Revert "Add SkipNativeNetworkCreation flag in NetworkAgentConfig"
This reverts commit fef111ce47.

Reason for revert: Replaced by early native network creation

Change-Id: I692f716d8651badf6d0037e55a2385d0fb0049d1

Junyu Lai   authored and   Gerrit Code Review   commited 2025-02-26 01:30:20 -08:00
b04a8048a1
Merge "Remove target preparer for epskc_enabled flag" into main
Yang Sun   authored and   Gerrit Code Review   commited 2025-02-26 01:19:33 -08:00
52fdeb421b
[Thread] In Integration test, let the DNS client wait for DNS server to show up in Network Data
The bring up delay of SRP server is higher than before. In the integration test case we need to explicitly wait for the SRP server to show up in Network Data. Otherwise the test may be flaky.

Bug: 399263029
Change-Id: Id6346bcbfd55a34103ba8de0dcee75d3cacde446

Handa Wang   commited 2025-02-26 01:16:41 -08:00
b68f4ace76
Merge "Never read device flag values in ConnectivityServiceTest." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-02-25 23:40:40 -08:00
bcd092b08c
Merge "Allow collecting diagnostics from shell commands" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2025-02-25 22:19:07 -08:00
97ff1b61e1
Never read device flag values in ConnectivityServiceTest.
ConnectivityServiceTest is a unit test and must never read
actual flag values from the device, because:
- If it did, its results would not be reproducible.
- At least on S and T, reading flags from device fails because
  the test lacks the READ_DEVICE_CONFIG permission.

Instead, throw a clear exception if ConnectivityService checks a
feature flag that is not explicitly set in the test.

Test: test-only change
Change-Id: Ic3855ffa944f170f5fda9c3456776f5e1f2ef388

Lorenzo Colitti   commited 2025-02-26 13:25:07 +09:00
2322bc04cb
Merge "Handling null interface in addLocalNetAccess, removeLocalNetAccess and getLocalNetAccess" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-02-25 20:20:49 -08:00
cbd6238696
Merge "Add edge case test for invalid program length in apf_run()." into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2025-02-25 19:38:00 -08:00
b458d99447
Allow collecting diagnostics from shell commands
Allow adding output from any shell command to the test diagnostics file,
instead of just dumpsys.

This introduces a new ShellUtil that can also help run more complex
commands, with pipes and redirects or as root for example.

Bug: 317602748
Test: atest with tests using this util
Change-Id: I0a0b5c7be5afd9e592dd820bfdbcee39ade418f8

Remi NGUYEN VAN   commited 2025-02-26 11:39:51 +09:00
47b6619fa8
Reverse pollingCheck arguments to be more kotlin friendly
Test: TH
Change-Id: Ibe52ccd9eec619ced5f8b84896d2a1efc6c0fefc

Patrick Rohr   commited 2025-02-25 15:30:52 -08:00
7f9469e808
Move pollingCheck to testutils
Test: TH
Change-Id: I7d9362dcda095f8037467baf3602911fc3a3c072

Patrick Rohr   commited 2025-02-25 15:30:51 -08:00
b4809fdd08
Merge "Stop forwarding when BluetoothSocket read returns -1" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-02-25 14:20:44 -08:00
028d6681fb
Merge "Move server reservation validation to L2capNetworkSpecifier" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-02-25 14:20:23 -08:00
3687f0e65e
Merge "Move client request validation to L2capNetworkSpecifier" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-02-25 14:18:19 -08:00
47669ff8e4
Merge changes Ic597ee91,I6a2b48aa,Ia71c79aa,I570dbff5,Ia063deea, ... into main
* changes:
  Get rid of volatile mIsAborted
  Get rid of volatile mIsRunning
  Add some more client network tests
  Add test for when BluetoothSocket#connect throws
  Add a test for when createInsecureL2capChannel throws
  Add a test that brings up an L2cap server network
  Move creating L2capIpClient to Dependencies

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-02-25 14:17:58 -08:00
695779c24d
Merge "Enable NetworkCallback optimizations by default." into main
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2025-02-25 13:28:01 -08:00
e71404b179
Enable NetworkCallback optimizations by default.
These optimizations are already launched to all public Pixel
devices and were in in 25Q2 beta releases as well. Enable them
by default on all supported releases. The appcompat risk is very
low (these changes are difficult even for an app to detect if
it's looking for them), the user benefits are substantial, and
there is a kill switch if any unforeseen issues do occur.

Bug: 327038794
Test: both codepaths are covered by existing tests
Change-Id: I42c7ceb71ef02d078bf4563744cb11afd412f267

Lorenzo Colitti   commited 2025-02-26 04:24:58 +09:00
2169522878
Merge "bpf: move isAtLeastX to BpfUtils.h" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-02-25 10:28:41 -08:00
3c39844ba6
Stop forwarding when BluetoothSocket read returns -1
When BluetoothSocket.InputStream#read() returns -1, the Bluetooth stack
closes the socket. Instead of dropping these packets, throw an exception
to tear down the link.

Test: TH
Change-Id: I7b78d01bc62383d9f93fa70cc4237e3604c98913

Patrick Rohr   commited 2025-02-25 09:43:18 -08:00
acbd2cce99
Move server reservation validation to L2capNetworkSpecifier
Test: TH
Change-Id: If0abf62bf008750d67d3687e5f59734421cce7cf

Patrick Rohr   commited 2025-02-25 09:26:08 -08:00
0508c94e14
Move client request validation to L2capNetworkSpecifier
Test: TH
Change-Id: Ied1af7edc60a0df01d820c2e81e16de980eb526f

Patrick Rohr   commited 2025-02-25 09:20:40 -08:00
bf65974835
Get rid of volatile mIsAborted
This has always been race-y as a socket exception could coincide with a
call to #close(). Since it is safe to run the full code paths for both
"regular" exceptions and exceptions triggered by the socket closing,
mIsAborted is not actually needed. This CL gets rid of it in favor of
simplicity.

Test: TH
Change-Id: Ic597ee917daffd6315c349dc435e5533b686bc2d

Patrick Rohr   commited 2025-02-25 09:14:11 -08:00
df26cda358
Get rid of volatile mIsRunning
The check for mIsRunning inside catch(IOException) was always race-y as
BluetoothServerSocket could have thrown an unrelated exception at the
same time tearDown() is called -- the only side effect being
inconsistent logging. However, it is safe to call
postDestroyAndUnregisterReservedOffer() as that function first checks
whether the offer still exists.

Therefore, this CL just gets rid of mIsRunning in favor of always
calling postDestroyAndUnregisterReservedOffer().

Test: TH
Change-Id: I6a2b48aa54dfa1ad55030bdcef847a1a9efa0787

Patrick Rohr   commited 2025-02-25 08:47:53 -08:00
adfe68f282
Merge "Revert "Add mapping to trigger NetworkSecurity unit tests on presubmit for tethering-mainline-presubmit"" into main
Sandro Montanari   authored and   Gerrit Code Review   commited 2025-02-25 04:29:39 -08:00
389d728168
Revert "Add mapping to trigger NetworkSecurity unit tests on presubmit for tethering-mainline-presubmit"
This reverts commit f37bf52f86.

Reason for revert: b/398885474

Change-Id: Ib5d6ee1fe2738518ba6c3de17c42bb59a673e6af

Sandro Montanari   authored and   Gerrit Code Review   commited 2025-02-25 02:45:00 -08:00
5a06ed3cb4
Merge "Update networksecurity resource owner" into main
Sandro Montanari   authored and   Gerrit Code Review   commited 2025-02-25 02:01:17 -08:00
486546c1f6
Merge "Add method to destroy UDP socket" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-02-24 22:59:07 -08:00
8d8ca6be82
Add method to destroy UDP socket
Upcoming CL adds feature to close quic connection which requires to
close UDP socket.

Bug: 311792075
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I63b7eb9c31cca9d00297a7a67c0cb18d0aa97a59

Motomu Utsumi   commited 2025-02-25 13:23:38 +09:00
7197820b15
Merge "Allow mDNS on IFF_POINTOPOINT interfaces" into main
Patrick Rohr   authored and   Gerrit Code Review   commited 2025-02-24 19:09:47 -08:00
81e6bdccd3
bpf: move isAtLeastX to BpfUtils.h
Partially due to:
  https://android-review.googlesource.com/c/platform/bionic/+/3497280

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I74a626c45d641e226d7f71e00d0b542c5701417d

Maciej Żenczykowski   commited 2025-02-24 18:58:22 -08:00
732386394e
Add some more client network tests
Test: TH
Change-Id: Ia71c79aa34c8fcfb078511543695ceddde4af53c

Patrick Rohr   commited 2025-02-24 17:02:36 -08:00
c060ffe22f
Add test for when BluetoothSocket#connect throws
Test: TH
Change-Id: I570dbff550ac1f1c167af5a25b471e41bf421dc2

Patrick Rohr   commited 2025-02-24 17:02:36 -08:00
e87e9241a0
Add a test for when createInsecureL2capChannel throws
Test: TH
Change-Id: Ia063deeaced151870138568e103a605a75813af9

Patrick Rohr   commited 2025-02-24 17:02:36 -08:00
d621b3d8aa
Add a test that brings up an L2cap server network
Test: TH
Change-Id: I9f2d750a822ce1790c9a766415ffc494a47d9287

Patrick Rohr   commited 2025-02-24 17:02:36 -08:00
1446e7a428
Move creating L2capIpClient to Dependencies
Unfortunately, the test does not have the permission to create an actual
IpClient. As a workaround, this change moves createL2capIpClient to the
depencencies object, so the test can mock the functionality.

Test: TH
Change-Id: I2b9128936f861bb822d80546efd72c14481bc2ed

Patrick Rohr   commited 2025-02-24 17:02:36 -08:00
a89224fea7
Merge changes Ia273344f,Iab107c58,I5d5bcafb,I0d96bfa3 into main
* changes:
  Delete unused createTapInterface method
  Delete unused createTapInterface method
  Replace createTapInterface() with new Builder API
  Replace createTapInterface() call with new Builder API

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-02-24 15:26:06 -08:00
3e9ac4ba7f
Handling null interface in addLocalNetAccess, removeLocalNetAccess and getLocalNetAccess
Bug: 398022752
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Change-Id: I4627fb83727d81108ed4629beb80a36e5433e140

Sarup Dalwani   commited 2025-02-24 20:13:46 +00:00
2e336acd5b
Merge "Remove obsolete APF_NEW_RA_FILTER_VERSION flag." into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-02-24 10:24:56 -08:00
c9f91e22eb
Delete unused createTapInterface method
Test: TH
Change-Id: Ia273344ffa26feec78e400e2df3e890081a15a23

Patrick Rohr   commited 2025-02-24 09:19:44 -08:00
95d7f5b56b
Delete unused createTapInterface method
Test: TH
Change-Id: Iab107c5804204295e714775b3b026a8e64795378

Patrick Rohr   commited 2025-02-24 09:19:44 -08:00
d14f094e12
Replace createTapInterface() with new Builder API
Test: TH
Change-Id: I5d5bcafb2b91dd31b7d2aa71f62279ab79d971bf

Patrick Rohr   commited 2025-02-24 09:19:44 -08:00
2bef486f76
Replace createTapInterface() call with new Builder API
Test: TH
Change-Id: I0d96bfa39a378a8dcc03c2366c332ae5eb8e69d6

Patrick Rohr   commited 2025-02-24 09:19:44 -08:00
f8471445dc
Merge "Add configuration object and builder for creating tun/tap interfaces" into main
Patrick Rohr   authored and   Gerrit Code Review   commited 2025-02-24 08:46:12 -08:00
f2bb2c85fa