diff options
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/util/Assert.java | 6 | ||||
-rw-r--r-- | tests/testables/src/android/testing/TestableLooper.java | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/util/Assert.java b/packages/SystemUI/src/com/android/systemui/util/Assert.java index 096ac3fcee1d..f6e921e628ba 100644 --- a/packages/SystemUI/src/com/android/systemui/util/Assert.java +++ b/packages/SystemUI/src/com/android/systemui/util/Assert.java @@ -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. @@ -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()); } } diff --git a/tests/testables/src/android/testing/TestableLooper.java b/tests/testables/src/android/testing/TestableLooper.java index 8d99ac7100eb..8eac3ea13a23 100644 --- a/tests/testables/src/android/testing/TestableLooper.java +++ b/tests/testables/src/android/testing/TestableLooper.java @@ -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); } |