summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHall Liu <hallliu@google.com>2020-05-13 18:34:11 -0700
committerHall Liu <hallliu@google.com>2020-05-14 01:43:16 +0000
commita853b23c0ed09fa492d71f3ef3bcead0a243d832 (patch)
tree34d6ff1a48a6d5b02350215367dbd999bbb75210
parent7121bc89c885f7fcf0270db62c1a7f07a0d5fa27 (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
-rw-r--r--tests/testables/src/android/testing/TestableLooper.java4
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 fe0224a27c80..ebe9b5706bf8 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;