Initial import of ADIF API reverse-engineering toolkit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package dagger.hilt.android.internal;
|
||||
|
||||
import android.os.Looper;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class ThreadUtil {
|
||||
private static Thread mainThread;
|
||||
|
||||
private ThreadUtil() {
|
||||
}
|
||||
|
||||
public static void ensureMainThread() {
|
||||
if (!isMainThread()) {
|
||||
throw new IllegalStateException("Must be called on the Main thread.");
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isMainThread() {
|
||||
if (mainThread == null) {
|
||||
mainThread = Looper.getMainLooper().getThread();
|
||||
}
|
||||
return Thread.currentThread() == mainThread;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user