summaryrefslogtreecommitdiff
path: root/tests/common/java/android/net/NetworkCapabilitiesTest.java
diff options
context:
space:
mode:
authormarkchien <markchien@google.com>2021-06-23 21:26:07 +0800
committermarkchien <markchien@google.com>2021-10-14 14:02:11 +0800
commit1110b725a07684f549d26b2c38a07eae2d9456f9 (patch)
treead2d6a5d5a2b3537ca33b70ee7139edf2b3064e0 /tests/common/java/android/net/NetworkCapabilitiesTest.java
parentc80a5d56db20b0e0b422d10132c5d069fa59af16 (diff)
Fix TetheringManager memory leak
TetheringCallbackInteranl is inner class which explicitly reference TetheringManager object. This causes TetheringManager can't be GC. Using static nested class which has its own lifecycle and weak reference TetheringManager object. Still have a leak inside Tethering that TetheringCallbackInternal is never unregistered. Currently it rely on binder died to remove the reference, which usually happen in kill process. If process keep alive, the TetheringCallbackInternal would not be freed even TetheringManager is gone. Will have follow CL to fix this. Bug: 177265744 Bug: 191798390 Bug: 187972579 Test: 1. lunch Settings with ON/OFF tethering, dump java heap. 2. close Settings and restart Settings again, dump java heap. 3. Compare java heap between step 1 and step 2. Change-Id: I0e2a21b7988115098a033a581cd98da8bffe2791
Diffstat (limited to 'tests/common/java/android/net/NetworkCapabilitiesTest.java')
0 files changed, 0 insertions, 0 deletions