Reduce main thread usage in sysui tests

Make assert more testable and fix up the tests in simple ways so
they still work but not on the main thread because that may or
may not, but is definitely not not flaky.

Test: atest frameworks/base/packages/SystemUI/tests
Change-Id: Ie19d772570b92c4b7f467f5ef9519f81500e63bc
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewTest.java
index 9e96df2..3582ab0 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewTest.java
@@ -20,10 +20,12 @@
 
 import android.test.suitebuilder.annotation.SmallTest;
 import android.testing.AndroidTestingRunner;
+import android.testing.TestableLooper;
 import android.testing.TestableLooper.RunWithLooper;
 import android.view.LayoutInflater;
 
 import com.android.systemui.SysuiTestCase;
+import com.android.systemui.util.Assert;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -32,7 +34,7 @@
 import org.mockito.Mock;
 
 @SmallTest
-@RunWithLooper(setAsMainLooper = true)
+@RunWithLooper
 @RunWith(AndroidTestingRunner.class)
 public class KeyguardStatusViewTest extends SysuiTestCase {
 
@@ -45,6 +47,7 @@
 
     @Before
     public void setUp() {
+        Assert.sMainLooper = TestableLooper.get(this).getLooper();
         LayoutInflater layoutInflater = LayoutInflater.from(getContext());
         mKeyguardStatusView =
                 (KeyguardStatusView) layoutInflater.inflate(R.layout.keyguard_status_view, null);