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

Commit 8947d758 authored by Beverly's avatar Beverly
Browse files

onDestroy, remove messages+callbacks on handler

Messages in the the KeyguardUpdateMonitor handler were still being
called after a test was finished, causing an assertMainThread exception
while running tests sometimes, so we would see flaky tests.

Test: atest SystemUITests
Fixes: 150592614
Change-Id: Ibd25e09948711054a4ef144cb54eaacfe566eeca
parent 70731d43
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2740,6 +2740,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab

        mBroadcastDispatcher.unregisterReceiver(mBroadcastReceiver);
        mBroadcastDispatcher.unregisterReceiver(mBroadcastAllReceiver);

        mHandler.removeCallbacksAndMessages(null);
    }

    @Override