summaryrefslogtreecommitdiff
path: root/framework/src/android/net/TestNetworkManager.java
Commit message (Collapse)AuthorAgeFilesLines
* Add a method to create a TAP interface with a given interface name.Xiao Ma2022-04-211-3/+32
| | | | | | | | | | | | | Add a method that allows the caller to specify whether to create a tap interface with a given specific interface name instead of the default one. So far only the given name that starts with "v4-testtap" or "v4-testtun" prefix is allowed. That's helpful to create a clat interface which always has "v4-" clat prefix in the IpClient integration test, to verify the callbacks happend on adding/removing clat interface. Bug: 163492391 Test: atest CtsNetTestCases Change-Id: I9ea7013fce919cafb719998a123164b5507f9ac0
* Add a method to create a TAP interface without bringing it up.Lorenzo Colitti2022-03-171-2/+25
| | | | | | | | | | | | | | | | | In S, the behaviour of createTunInterface and createTapInterface changed so that they bring up the interface before returning it. This makes it difficult to test code that brings interfaces up itself, such as IpClient or EthernetManager, because the tests cannot predict whether that code will see the interface up or not. This leads to flaky tests and can even make it impossible to reliably test some behaviour. Add a method that allows the caller to specify whether to bring up the interface or not. Test: new codepath tested by other CL in topic Test: existing codepaths already well-covered Change-Id: I0f7698f4dad132f201db4203e65a78c6af564ab2
* Add RequiresPermission to TestNetworkManagerRemi NGUYEN VAN2021-04-081-0/+6
| | | | | | | | | All API methods in TestNetworkManager require the MANAGE_TEST_NETWORKS permission. Fixes: 183972672 Test: m Change-Id: Ic5929c24ea88d7259d367a81fec8f223a2e3ecb0
* Revert "Revert "Remove connectivity dependency on Preconditions""Remi NGUYEN VAN2021-03-221-4/+3
| | | | | | | | | | | | | | Preconditions.checkNotNull is deprecated to be replaced by Objects.requireNonNull, and other methods can easily be replaced by inline checks. Preconditions is an internal API class that should not be used by unbundled jars. Bug: 177046265 Change-Id: I3a67d266b32142c034520acbcdc30f7213db5e13 Merged-In: I3a67d266b32142c034520acbcdc30f7213db5e13 Test: m
* Revert "Remove connectivity dependency on Preconditions"Remi NGUYEN VAN2021-03-151-3/+4
| | | | | | | | This reverts commit 62b1df44a24249e1d9a50fbf3b6bf2f75b1b6724. Reason for revert: Build broken: b/182721112 Change-Id: Ibc84ec6d7900fdcf0bc14cd7036f9c08287711db
* Remove connectivity dependency on PreconditionsRemi NGUYEN VAN2021-03-111-4/+3
| | | | | | | | | | | | | Preconditions.checkNotNull is deprecated to be replaced by Objects.requireNonNull, and other methods can easily be replaced by inline checks. Preconditions is an internal API class that should not be used by unbundled jars. Bug: 177046265 Test: m Change-Id: If14a75439ff332c927dc4114ae0eecb89f53c6c7
* Expose TEST_TAP_PREFIX as system APIlucaslin2021-02-061-1/+0
| | | | | | | | | | TestNetworkManager is a part of connectivity mainline module and it is already a system API, but its constant - TEST_TAP_PREFIX is hidden, so expose it for the callers inside framework. Bug: 172183305 Test: make update-api Change-Id: I7fc08be4a6ca6325d5b576b761afda17865cefaa
* Move module sources to packages/ConnectivityRemi NGUYEN VAN2021-02-011-0/+178
Files that are planned to be part of the connectivity module are grouped in packages/Connectivity, so they can be built separately and moved in one operation with their history into packages/modules/Connectivity. This places the files in the existing framework-connectivity-sources filegroup instead of the current framework-core-sources filegroup. Both are used the same way in framework-non-updatable-sources. Bug: 171540887 Test: m Change-Id: I62d9d91574ace6f5c4624035d190260c3126b91e