63203afe0e96226273aa528eb0a82f3314c4531f
In R, to avoid data overages due to apps not detecting a meteredness change, when a wifi network changes from unmetered to metered the network will go down and will be replaced with a new network. It will make NetworkCallbackTest fail because the original design is getting the active network in setUp(). So once the wifi reconnects, the network which is got in setUp() will be meaningless and make the test fail due to network mismatches. The new changes are: 1. Moving some initial pre-configurations into setUp(). 2. Override the onCapabilitiesChanged() to check if network has changed to metered or not. 3. Add unregisterNetworkCallback() into iMyService.aidl so that NetworkCallbackTest can call it to unregister the network callback. 4. Enlarge the timeout of connecting network and receiving callback to prevent network cannot reconnect in time or callback cannot be received in a short time. Bug: 153485744 Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideNetworkCallbackTests Change-Id: I1aa0e107cf6797b06dee4a15896c63321d822156
Description
android_packages_modules_Connectivity
Languages
Java
81.4%
Kotlin
7.7%
AIDL
4.5%
C++
4.5%
C
1.7%
Other
0.1%