ee8feba3c12bed28e754c872ec4adea21394d42f
This change fixes several things in ConnectivityDiagnosticsManagerTest: - testOnConnectivityReportAvailable creates the Test Network after registering the ConnectivityDiagnosticsCallback. This ensures that the callback is invoked only after the network is validated (not for the on-register behavior). - The TestNetworkInterface created while setting up the Test Network is held onto for the duration of each test. This ensures that the interface is not garbage collected during the test. While the interface is not needed for the test, this change makes it clear when the interface is cleaned up. - All registered ConnectivityDiagnosticsCallbacks are unregistered at the end of each test. This ensures that all accompanying NetworkRequests are cleaned up. If NetworkRequests are leaked, unrelated test failures can occur (the platform limits the number of NetworkRequests per UID). Bug: 156294356 Bug: 148032944 Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest Change-Id: I1836536fe60a65ba33170cd80e8f4996f1965d19 Merged-In: I1836536fe60a65ba33170cd80e8f4996f1965d19
Description
android_packages_modules_Connectivity
Languages
Java
81.4%
Kotlin
7.7%
AIDL
4.5%
C++
4.5%
C
1.7%
Other
0.1%