Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 669b633e authored by David Saff's avatar David Saff
Browse files

Clear TestableLoopers in SysuiTestCase

Bug: 261039202
Test: presubmit to verify this doesn't break existing tests
Test: See b/259992416 for analysis of how this improves memory pressure.
Change-Id: Ifa1b489b8dff354a29727fb61342ac9b82ec65e7
parent 1549391e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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());