* changes:
Revert "Return the registry in registerNetworkAgent."
Revert "Unify registration and NM assignment in NAI"
Revert "Add a queue system server-side for NetworkAgent"
Pechetty Sravani (xWF)authored and Gerrit Code Reviewcommited 2025-03-17 02:23:26 -07:00
Revert submission 3535182
Reason for revert: <Droidmonitor created revert due to b/404070202.Will be verified through ABTD for standard investigation.>
Reverted changes: /q/submissionid:3535182
Change-Id: I2febd2ee7227d487d9cd69dcabd9c04f888fd2de
Revert submission 3535182
Reason for revert: <Droidmonitor created revert due to b/404070202.Will be verified through ABTD for standard investigation.>
Reverted changes: /q/submissionid:3535182
Change-Id: I65fdaaacb56c8ef227eaf1a0193efe8d332d6473
Revert submission 3535182
Reason for revert: <Droidmonitor created revert due to b/404070202.Will be verified through ABTD for standard investigation.>
Reverted changes: /q/submissionid:3535182
Change-Id: Id48ef1cf44911cb291bcd8db349934751297718b
Pechetty Sravani (xWF)authored and Gerrit Code Reviewcommited 2025-03-17 00:48:05 -07:00
The intent is to remove the queue on the NetworkAgent side.
This queue is triggered with the same conditions as the
existing one.
Test: ConnectivityCoverageTests, CtsNetTests
Change-Id: I4bc29b10e48e13cdf3c3a8a15a7c8d15954d2457
Registration is marked by the creation of the network monitor
for a given network agent. This patch makes this fact much
more ovbious.
Test: CtsNetTests ConnectivityCoverageTests
Change-Id: I94a56b2bce6f453322b1eb91d6a6f14b31e7a95f
This is a resubmit of
I0fd90716b9f5501bdcdc7ee5165321737a0076ae
which did not account for testing of this private method
in Telephony tests.
Also make the network agent registry two way to eliminate
reordering possibilities.
Test: ConnectivityCoverageTest, CtsNetTests
Change-Id: I9ca025b1369dcb1202f906d5cff79e3d935b40da
Adding mechanism to track interaface name to interface index, this map
would be used by BpfNetMaps for storing interface index.
Bug: 400681214
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.InterfaceTrackerTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Change-Id: I2a65cac908d9c4d10714e3fe26be20322d4a1db3
This reverts commit 70ede3260c.
Reason for revert: Likely culprit for b/402365566 - 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: If72cc264c5e505348309c6c11dbbfd11adeaf31b
Chaitanya Cheemala (xWF)authored and Gerrit Code Reviewcommited 2025-03-11 06:05:49 -07:00
Also make the network agent registry two way to eliminate
reordering possibilities.
Test: ConnectivityCoverageTest, CtsNetTests
Change-Id: I0fd90716b9f5501bdcdc7ee5165321737a0076ae
This is needed by tethering local network feature, given that
the IpServer needs to setup forwarding after native network
creation and before signaling network availability.
Test: atest CtsNetTestCases:android.net.cts.NetworkAgentTest \
ConnectivityCoverageTests:android.net.EthernetTetheringTest \
ConnectivityCoverageTests:android.net.connectivity.com.android.server.ConnectivityServiceTest \
--update-device
Bug: 349487600
Change-Id: I2bc2ec355e01be661b587406bd127dff11665047
Removing a multicast virtual interface with setsockoptMrt6DelMif may
return error if the interface is already gone. This is expected behavior
and should be logged as a warning instead of error.
Bug: 400596719
Change-Id: I11bfe22be5dc2479768dbc1b53eb7feeec27af3f
PendingIntent.send will throw CanceledException when the intent
can't be sent, because it was canceled or some other reason. In
some, but not all of these cases, it will still call onSendFinished
after the send is done. This means there is no way to be sure
to do something exactly once after the intent is sent.
Unfortunately, ConnectivityService must keep a wakelock until
sent is finished, and wakelocks must be released exactly once.
Too bad.
The simplest solution is to create a specialized listener object
that can manage the lifecycle of the wakelock. This allows
very localized code, easy review and checking, cheap thread
safety, and not creating multiple locks. It also avoids the
ConnectivityService class implementing OnFinished itself,
which is arguably not very readable considering how big
the class is.
Test: new test that crashes the system without the patch
Fixes: 390043283
Change-Id: Ice528eddaedb4d663098eb2bb0ae7183dafbc073
* 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 Żenczykowskiauthored and Gerrit Code Reviewcommited 2025-02-25 14:17:58 -08:00
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 Colitticommited 2025-02-26 04:24:58 +09:00
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
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
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
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
This CL introduces ThreadLeakMonitor for CSL2capProviderTest.
ThreadLeakMonitor ignores threads with unique names, so all
L2capNetworkProvider related threads must specify a name.
Test: TH
Change-Id: I7cfcc93ab562a1ada2058d8c73e968a8d0005b1d
As was pointed out on the doc, "bandwidth constrained" implies that data
on this network costs money to the user, e.g. a satellite network. This
is not the case for an IPv6 over BLE network, so the TODO can be
removed.
Test: TH
Change-Id: Ide854634381d24c2f2fa49dc099f86f4cc2d813b
This CL adds thread checks to various functions. It also adds 2 missing
@Override annotations to make it clear that run() is part of the Thread
itself.
Test: TH
Change-Id: Ic89a85b25bdf6afaab0310a641956001d7c83a77
Addressing feedback from previous change "Adding stacked link addresses
to local_net_access map" and adding more test cases for impact of
stacked link properties on local network prefixes.
Bug: 369815823
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.CSLocalNetworkProtectionTest
Change-Id: I4d32d86d3e083a1a14b845583fd80a7a4b18ae5f
This effectively cannot happen for IPv6 link-local only provisioning
unless the interface goes away during "provisioning".
Test: TH
Change-Id: Ib2c5238fdb816e74afa2300017f1014f9376ad17
Provisioning can fail if the interface disappears. This CL splits
IpClient provisioning into the create function which will eventually
return null when provisioning fails.
Test: TH
Change-Id: Ie815b0781c7642c05684438525290067d17d1a9e
To avoid logging requests with empty capabilities and no
NetworkSpecifier. This also renames the validation functions for clarity
as was suggested in a previous review, and changes the Log.w to Log.i if
the specifier is invalid.
Test: TH
Bug: 397130676
Change-Id: I488b466f83f85ea9f3c067c95c4e01846560dea7