diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/SysuiTestCase.java b/packages/SystemUI/tests/utils/src/com/android/systemui/SysuiTestCase.java index fa3cc9905c3f4..bf2235aa98a9b 100644 --- a/packages/SystemUI/tests/utils/src/com/android/systemui/SysuiTestCase.java +++ b/packages/SystemUI/tests/utils/src/com/android/systemui/SysuiTestCase.java @@ -136,6 +136,8 @@ public abstract class SysuiTestCase { InstrumentationRegistry.getArguments()); if (TestableLooper.get(this) != null) { TestableLooper.get(this).processAllMessages(); + // Must remove static reference to this test object to prevent leak (b/261039202) + TestableLooper.remove(this); } disallowTestableLooperAsMainThread(); mContext.cleanUpReceivers(this.getClass().getSimpleName());