summaryrefslogtreecommitdiff
path: root/tests/unit/java/android/net/EthernetNetworkUpdateRequestTest.java
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2022-02-16 14:59:00 +0900
committerLorenzo Colitti <lorenzo@google.com>2022-03-14 21:52:37 +0900
commitffa2ed3d1c0f4ddd382e0c28108ff8da547ff10b (patch)
treecdefa1e16b2812b964ceac1a64a542bc3a42c840 /tests/unit/java/android/net/EthernetNetworkUpdateRequestTest.java
parent3938102448ee8990f62ac9c387ba8dc9afe6f2b7 (diff)
Add a NetworkAgent API to indicate that a network will be replaced.
This is useful for link layers that disconnect but know they will reconnect to a similar network soon, and do not want the device to switch to another network until the reconnect happens. An example is wifi switching to another network that is on a different subnet without the device switching to cellular data. This works by immediately destroying the network, so the link layer can reuse the same interface name for the new network. It would be possible to delay destroying the network until the new network connects, but in practice this does not seem useful, because the if the link layer reuses the interface, then the interface will be undergoing reconfiguration, and will likely not be usable for app traffic. This CL also moves the call to onNetworkDestroyed into destroyNativeNetwork. This is needed to ensure that the new API calls onNetworkDestroyed even though most teardown operations have not happened. This causes onNetworkDestroyed to happen before the netId is marked free, but that shouldn't cause any behavioural changes because netId allocation is an implementation detail of ConnectivityService and is not observable by apps or system components. Bug: 216567577 Test: builds, boots Test: atest FrameworksNetTests FrameworksNetIntegrationTests Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest Test: atest CtsNetTestCases:android.net.cts.NetworkAgentTest#testDestroyAndAwaitReplacement Change-Id: I9f9e022fef66b31a29cce560413321075e992756
Diffstat (limited to 'tests/unit/java/android/net/EthernetNetworkUpdateRequestTest.java')
0 files changed, 0 insertions, 0 deletions