diff options
| author | 2020-05-13 18:34:11 -0700 | |
|---|---|---|
| committer | 2020-05-15 23:47:07 +0000 | |
| commit | edb35aa6e2f85a19a282778e13cd68de67c291b8 (patch) | |
| tree | c47c9038ead0739db472b10b3e5993f7dbf474c8 /tests | |
| parent | 6bf3920e7d35414792569c0d87df83fefdf6526f (diff) | |
Add method to remove test from tracked loopers
Add method to remove a test from the sLoopers map, since keeping them
around forever results in a memory leak for large test suites.
Bug: 156287358
Test: atest FrameworksTelephonyTests
Change-Id: I553ea3a1dac3ff4107e0c7caabee26d21f4c52f8
Merged-In: I553ea3a1dac3ff4107e0c7caabee26d21f4c52f8
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/testables/src/android/testing/TestableLooper.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/testables/src/android/testing/TestableLooper.java b/tests/testables/src/android/testing/TestableLooper.java index 8d99ac7100eb..7218ae3550c6 100644 --- a/tests/testables/src/android/testing/TestableLooper.java +++ b/tests/testables/src/android/testing/TestableLooper.java @@ -222,6 +222,10 @@ public class TestableLooper { return sLoopers.get(test); } + public static void remove(Object test) { + sLoopers.remove(test); + } + static class LooperFrameworkMethod extends FrameworkMethod { private HandlerThread mHandlerThread; |