Add tests for requestNetwork and registerNetworkCallback with
PendingIntents that are equal as per PendingIntent.intentFilterEquals.
In such situations, the first request is documented to be automatically
unregistered. This means that the PendingIntent should only be fired
once, instead of being fired for both requests.
Currently this behavior is broken for network callbacks (not for network
requests).
Test: atest ConnectivityManagerTest
Bug: 174237997
Change-Id: Ic636c731c71474ef09043d7a26ccfd6e2bb5c39f
ConnectivitySettingsManager and CtsNetUtils are doing the same
thing to set/get private DNS related settings.
To prevent making the duplication code in two places, move the
body to frameworks/libs/net and call it.
Bug: 185311744
Test: atest CtsNetTestCases CtsNetTestCasesLatestSdk
Change-Id: I3272c825b86ec30c3d0bf4097088c653e668461b
Many applications use ConnectivityManager without needing
TetheringManager (or without calling legacy ConnectivityManager methods
that delegate to TetheringManager), so initializing TetheringManager
when ConnectivityManager is created wastes resources.
This is especially true considering that TetheringManager is not trivial
to initialize (worst case scenario it starts a thread and does multiple
Binder requests), and ConnectivityManager is created in ActivityThread
when setting up the app proxy on startup.
Bug: 190556328
Test: atest FrameworksNetTests CtsNetTestCases TetheringTests
Change-Id: I2ba7b8f2b9e1c934cfb082776b8d643f2f2c17e5
BYPASS_INCLUSIVE_LANGUAGE_REASON=To make the change more clear,
fix the inclusive problem in a follow-up commit.
Bug: 176289731
Test: atest CtsHostsideNetworkTests:HostsideNetworkPolicyManagerTests
Change-Id: Ie6bda8570979b10a28dbeb20f6db7a9c44735964
This is a op CL which prepare for refactor.
Bug: 185649441
Bug: 189410000
Bug: 178116595
Test: atest TetheringTests
Change-Id: I270ff43c01736b9d18bd40a8e88e1379e9e4e863
Adding the configuration to decide using rndis or ncm for usb tethering.
If ncm is configured for TETHEIRNG_USB, then TETHERING_NCM is not
available.
Bug: 162920185
Test: atest TetheringTests
manul testing usb tethering
Change-Id: Ifc7eee2457a950a0e2d1c3cc89a3373a7ad23c9c
This CL adds tests to verify that after setting
IpSecTunnelInterface to use a different undelying network and
re-applying IpSecTransforms with matching addresses, traffic
can be routed to/from the new underlying network.
All these new tests will be skipped if SDK < S
Bug: 169855650
Test: atest IpSecManagerTunnelTest (new tests added)
Change-Id: Iab26159e5e070574e552d62e4f0780059a51a9c7
Increasing the timeout values for waiting for callbacks for the per-app
CTS tests to match the timeout value used in the waitForAvailable()
helper method.
Bug: 191230288
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Change-Id: I49e5a99f18a5651370e6914f30be659134b537ff
The always bit is verified in NetworkAgentTest. There is no easy
configuration to set an explicitly selected network to accept an
unvalidated network. Verify the accepted case also in
NetworkAgentTest.
Bug: 186061922
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I803eb975fb0b6c52d55b2310293bcad407d21f42
* changes:
Fix expectCallback does not fail when no callback received
Add CTS for registerBestMatchingNetworkCallback
No-op refactoring of NetworkAgentTest
The coverage tests will allow measuring code coverage for all
Connectivity+Tethering code.
This is a combination of the current TetheringCoverageTests, and
FrameworksNetTests.
Adding min_sdk_version to the test prevents it from using deprecated
IoUtils utilities. Replace it with the non-deprecated alternative.
Test: atest ConnectivityCoverageTests
Change-Id: I5366e1cc9cd6ddb41f24718246381cc2b1cc1383
The test will currently fail if it is run in a package that has
ACCESS_NETWORK_STATE. Add utilities to mock permissions, and mock the
ACCESS_NETWORK_STATE permission to be denied.
Bug: 187935317
Test: atest TetheringServiceTest
Change-Id: I8df5f2ac21bf0314098e8c2e5ba583676ae8ab38
This does not change the mockito library to use mockito-extended in
FrameworksNetTests, but changes the tests so that they would pass if
built against that library.
This is useful to run FrameworksNetTests in a common test suite with
other tests that use mockito-extended, for example a common connectivity
coverage test target.
The change includes increasing the test timeout in
ConnectivityServiceTest, as mockito-extended can have performance impact
(~3 times on hwasan builds). This change does not make tests run slower
in the current FrameworksNetTests suite though.
Bug: 187935317
Test: atest FrameworksNetTests
Change-Id: I61fa371e8957037075a2617a014647ff062207c6
To allow unit tests to run without platform certificates, remove
signature permission usage in ConnectivityServiceTest.
This mocks permission checks done in ConnectivityService for which the
test assumed that the permission was held, and mocks calls to
BatteryStatsManager. Calls to ActivityManagerService (through
PendingIntent) are done with shell permissions as the test uses real
PendingIntent mechanics.
Bug: 187935317
Test: atest FrameworksNetTests
Change-Id: If309d653ac2e9bbcf1b94bcee6336367289df359