summaryrefslogtreecommitdiff
path: root/tests/common/java/android/net/NetworkCapabilitiesTest.java
diff options
context:
space:
mode:
authorWeiZhang <e7976c@motorola.com>2021-06-03 19:02:04 -0500
committerJunyu Lai <junyulai@google.com>2021-06-30 12:05:43 +0000
commit1cc3f1741339cc9c6a956526ed7177161402eaa4 (patch)
tree14dd08cd2c30e06465b1268e3ac24282cb1021fa /tests/common/java/android/net/NetworkCapabilitiesTest.java
parentd8a8041ffc1f18f8f257ee75918b44f57448fdac (diff)
Fix network callback with the same PendingIntent does not release
Currently, ConnectivityService uses EVENT_REGISTER_NETWORK_LISTENER to dispatch registering network callback with pending intent, this is wrong since the code flow will not check if the pending intent is duplicated. Thus, the registration will be duplicated if the caller uses the same pending intent and register multiple times. This change fixes the logic by using EVENT_REGISTER_NETWORK_LISTENER_WITH_INTENT instead of EVENT_REGISTER_NETWORK_LISTENER when dispatching register network callback with pending intent. Test: atest android.net.cts.ConnectivityManagerTest#testRegisterNetworkRequest_identicalPendingIntents Test: atest android.net.cts.ConnectivityManagerTest#testRegisterNetworkCallback_identicalPendingIntents Test: atest ConnectivityServiceTest#testNetworkCallbackMaximum Test: 1. Use test app to file callback with same PendingIntent 2. Check dumpsys output Bug: 189868426 Change-Id: I38bdea3a026a78a6dc34b5200d43a75b3cd1ac0c
Diffstat (limited to 'tests/common/java/android/net/NetworkCapabilitiesTest.java')
0 files changed, 0 insertions, 0 deletions