Loading packages/SystemUI/src/com/android/systemui/util/Assert.java +4 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ package com.android.systemui.util; import android.os.Looper; import com.android.internal.annotations.VisibleForTesting; import androidx.annotation.VisibleForTesting; /** * Helper providing common assertions. Loading @@ -30,7 +30,9 @@ public class Assert { public static void isMainThread() { if (!sMainLooper.isCurrentThread()) { throw new IllegalStateException("should be called from the main thread."); throw new IllegalStateException("should be called from the main thread." + " sMainLooper.threadName=" + sMainLooper.getThread().getName() + " Thread.currentThread()=" + Thread.currentThread().getName()); } } Loading tests/testables/src/android/testing/TestableLooper.java +1 −0 Original line number Diff line number Diff line Loading @@ -234,6 +234,7 @@ public class TestableLooper { try { mLooper = setAsMain ? Looper.getMainLooper() : createLooper(); mTestableLooper = new TestableLooper(mLooper, false); mTestableLooper.getLooper().getThread().setName(test.getClass().getName()); } catch (Exception e) { throw new RuntimeException(e); } Loading Loading
packages/SystemUI/src/com/android/systemui/util/Assert.java +4 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ package com.android.systemui.util; import android.os.Looper; import com.android.internal.annotations.VisibleForTesting; import androidx.annotation.VisibleForTesting; /** * Helper providing common assertions. Loading @@ -30,7 +30,9 @@ public class Assert { public static void isMainThread() { if (!sMainLooper.isCurrentThread()) { throw new IllegalStateException("should be called from the main thread."); throw new IllegalStateException("should be called from the main thread." + " sMainLooper.threadName=" + sMainLooper.getThread().getName() + " Thread.currentThread()=" + Thread.currentThread().getName()); } } Loading
tests/testables/src/android/testing/TestableLooper.java +1 −0 Original line number Diff line number Diff line Loading @@ -234,6 +234,7 @@ public class TestableLooper { try { mLooper = setAsMain ? Looper.getMainLooper() : createLooper(); mTestableLooper = new TestableLooper(mLooper, false); mTestableLooper.getLooper().getThread().setName(test.getClass().getName()); } catch (Exception e) { throw new RuntimeException(e); } Loading