ThreadToolUtils.smali

.class public final Lcom/sandboxol/common/threadpoollib/utils/ThreadToolUtils;
.super Ljava/lang/Object;
.source "ThreadToolUtils.java"


# static fields
.field public static isAndroid:Z


# direct methods
.method static constructor <clinit>()V
    .registers 1

    const-string v0, "android.os.Build"

    .line 1
    :try_start_2
    invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    const/4 v0, 0x1

    .line 2
    sput-boolean v0, Lcom/sandboxol/common/threadpoollib/utils/ThreadToolUtils;->isAndroid:Z
    :try_end_8
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_8} :catch_9

    goto :goto_c

    :catch_9
    const/4 v0, 0x0

    .line 3
    sput-boolean v0, Lcom/sandboxol/common/threadpoollib/utils/ThreadToolUtils;->isAndroid:Z

    :goto_c
    return-void
.end method

.method public constructor <init>()V
    .registers 1

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method static synthetic a(Lcom/sandboxol/common/threadpoollib/callback/ThreadListener;Ljava/lang/String;Ljava/lang/Thread;Ljava/lang/Throwable;)V
    .registers 4

    if-eqz p0, :cond_5

    .line 1
    invoke-interface {p0, p1, p3}, Lcom/sandboxol/common/threadpoollib/callback/ThreadListener;->onError(Ljava/lang/String;Ljava/lang/Throwable;)V

    :cond_5
    return-void
.end method

.method public static configThread(Ljava/lang/Thread;Ljava/lang/String;Lcom/sandboxol/common/threadpoollib/callback/ThreadListener;)V
    .registers 4

    .line 1
    new-instance v0, Lcom/sandboxol/common/threadpoollib/utils/a;

    invoke-direct {v0, p2, p1}, Lcom/sandboxol/common/threadpoollib/utils/a;-><init>(Lcom/sandboxol/common/threadpoollib/callback/ThreadListener;Ljava/lang/String;)V

    invoke-virtual {p0, v0}, Ljava/lang/Thread;->setUncaughtExceptionHandler(Ljava/lang/Thread$UncaughtExceptionHandler;)V

    .line 2
    invoke-virtual {p0, p1}, Ljava/lang/Thread;->setName(Ljava/lang/String;)V

    return-void
.end method

.method public static sleepThread(J)V
    .registers 5

    const-wide/16 v0, 0x0

    cmp-long v2, p0, v0

    if-gtz v2, :cond_7

    return-void

    .line 1
    :cond_7
    :try_start_7
    invoke-static {p0, p1}, Ljava/lang/Thread;->sleep(J)V
    :try_end_a
    .catch Ljava/lang/InterruptedException; {:try_start_7 .. :try_end_a} :catch_b

    return-void

    :catch_b
    move-exception p0

    .line 2
    new-instance p1, Ljava/lang/RuntimeException;

    const-string v0, "Thread has been interrupted"

    invoke-direct {p1, v0, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    throw p1
.end method