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

Commit ba8fe2f1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add extra logging for Assert.isMainThread"

parents 12e2065d 2563d216
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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());
        }
    }

+1 −0
Original line number Diff line number Diff line
@@ -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);
            }