I didn't notice repo had failed the last upload with error 500...
This patch addresses the last outstanding comment.
Test: ConnectivityManagerTest
Change-Id: I970613a71e0b1854261e9615ff113a1d404fc1d0
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
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 Reviewcommited 2025-02-26 12:20:26 -08:00
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
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 Colitticommited 2025-02-26 13:25:07 +09:00
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
* 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
All the 3 meshcop_xxx CTS tests in ThreadNetworkControllerTest are
flaky:
1. meshcopService_threadEnabledButNotJoined_discoveredButNoNetwork fails
if thread is disabled and then enabled
2. meshcopService_threadDisabled_notDiscovered fails if the discovery is
not specifically on the test network
3. meshcopService_joinedNetwork_discoveredHasNetwork is already flaky
Bug: 332195449
Bug: 333649897
Bug: 396311014
Change-Id: Ibd3f7b05bddb6b28408f9411350e364dd720b335
Upcoming CL adds feature to close quic connection which requires to
close UDP socket.
Bug: 311792075
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I63b7eb9c31cca9d00297a7a67c0cb18d0aa97a59
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
* changes:
Delete unused createTapInterface method
Delete unused createTapInterface method
Replace createTapInterface() with new Builder API
Replace createTapInterface() call with new Builder API
Maciej Żenczykowskiauthored and Gerrit Code Reviewcommited 2025-02-24 15:26:06 -08:00