summaryrefslogtreecommitdiff
path: root/tests/common/java/android/net/NetworkCapabilitiesTest.java
diff options
context:
space:
mode:
authorChalard Jean <jchalard@google.com>2021-07-19 19:57:02 +0900
committerChalard Jean <jchalard@google.com>2021-07-27 04:37:29 +0000
commit5bcc838f4e5923c069e9554a9d050d4286a81790 (patch)
tree88bcb579da455112061674929609184da66cb3c4 /tests/common/java/android/net/NetworkCapabilitiesTest.java
parent02d7eb2abe0e61dc3648d1eac4b7f925567a4d7b (diff)
Fix a possible system server crash
The scenario is as follows : an app registers a network callback, then unregisters it and dies immediately after. In this scenario, the system server will receive a notification of the binder death and enqueue a call to handleRemoveNetworkRequest. If the callback unregister message has been process first, this call would result in unlinkToDeath being called twice on the same Binder, crashing. This patch fixes the problem by using handleReleaseNetworkRequest instead of Remove, which looks up the NRI in a map on the handler thread before calling Remove, returning without doing anything if the NRI has already been removed. Test: ConnectivityServiceTest Test: New test for this Bug: 194394697 Change-Id: I82a28c37450146838410bf5a059aac295a985fca
Diffstat (limited to 'tests/common/java/android/net/NetworkCapabilitiesTest.java')
0 files changed, 0 insertions, 0 deletions