summaryrefslogtreecommitdiff
path: root/tests/common/java/android/net/NetworkCapabilitiesTest.java
diff options
context:
space:
mode:
authorChiachang Wang <chiachangwang@google.com>2021-08-05 10:14:17 +0800
committerChiachang Wang <chiachangwang@google.com>2021-08-05 19:47:20 +0800
commit7a45f107deb5e64fa36e9271055cd51e1e47b1b5 (patch)
tree8e552cb6b6606eb06a7b398169fbb9245f7fc72b /tests/common/java/android/net/NetworkCapabilitiesTest.java
parent740cda435860698a7fd91c5aa423de2230d7c47c (diff)
Do callback unregistration automatically in tearDown
Ideally, unregisterCallbackQuietly() is only needed when the callback is registered in the try block. The callbacks registration located outside the try block should be registered theoretically. Otherwise, it may be a bug if the tests get the IllegalArgumentException. Use unregisterCallbackQuietly() in all finally may cause bug in unregisterNetworkCallback invisible. However, it may cause different tests with different code to do the unregistration. Thus, do a refactor to add some methods to wrap the NetworkCallback registration. This allows the tests to do the unregister automatically in the tearDown(). Bug: 195364778 Test: atest android.net.cts.ConnectivityManagerTest Change-Id: If06993f643ac7aeb23638a283347c427934a2f99
Diffstat (limited to 'tests/common/java/android/net/NetworkCapabilitiesTest.java')
0 files changed, 0 insertions, 0 deletions