RealCall$AsyncCall.smali

.class final Lokhttp3/RealCall$AsyncCall;
.super Lokhttp3/internal/NamedRunnable;
.source "SourceFile"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lokhttp3/RealCall;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x11
    name = "AsyncCall"
.end annotation


# static fields
.field public static final synthetic $assertionsDisabled:Z


# instance fields
.field private final responseCallback:Lokhttp3/Callback;

.field public final synthetic this$0:Lokhttp3/RealCall;


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

    const-class v0, Lokhttp3/RealCall;

    return-void
.end method

.method public constructor <init>(Lokhttp3/RealCall;Lokhttp3/Callback;)V
    .registers 5

    .line 1
    iput-object p1, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    const/4 v0, 0x1

    new-array v0, v0, [Ljava/lang/Object;

    .line 2
    invoke-virtual {p1}, Lokhttp3/RealCall;->redactedUrl()Ljava/lang/String;

    move-result-object p1

    const/4 v1, 0x0

    aput-object p1, v0, v1

    const-string p1, "OkHttp %s"

    invoke-direct {p0, p1, v0}, Lokhttp3/internal/NamedRunnable;-><init>(Ljava/lang/String;[Ljava/lang/Object;)V

    .line 3
    iput-object p2, p0, Lokhttp3/RealCall$AsyncCall;->responseCallback:Lokhttp3/Callback;

    return-void
.end method

.method public static INVOKEINTERFACE_okhttp3_RealCall$AsyncCall_com_shopee_app_asm_anr_threadpool_ExecutorProxy_execute(Ljava/util/concurrent/ExecutorService;Ljava/lang/Runnable;)V
    .registers 4

    .line 1
    invoke-static {}, Lcom/shopee/app/asm/anr/threadpool/c;->b()Z

    move-result v0

    if-eqz v0, :cond_3a

    invoke-static {}, Lcom/shopee/app/asm/anr/threadpool/c;->a()Z

    move-result v0

    if-eqz v0, :cond_3a

    .line 2
    :try_start_c
    sget-object v0, Lcom/shopee/app/asm/anr/threadpool/c;->a:Landroid/os/HandlerThread;

    .line 3
    sget-object v0, Lcom/shopee/app/asm/anr/threadpool/c;->b:Landroid/os/Handler;

    new-instance v1, Lcom/shopee/app/asm/anr/threadpool/a$b;

    invoke-direct {v1, p0, p1}, Lcom/shopee/app/asm/anr/threadpool/a$b;-><init>(Ljava/util/concurrent/Executor;Ljava/lang/Runnable;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
    :try_end_18
    .catchall {:try_start_c .. :try_end_18} :catchall_19

    goto :goto_54

    :catchall_19
    move-exception v0

    .line 4
    invoke-virtual {v0}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;

    sget-object v0, Lcom/shopee/app/asm/anr/threadpool/c;->a:Landroid/os/HandlerThread;

    .line 5
    :try_start_1f
    invoke-static {p1, p0}, Lcom/shopee/app/asm/anr/threadpool/a;->a(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_2b

    .line 6
    sget-object p0, Lcom/shopee/app/asm/fix/threadpool/global/i;->e:Lcom/shopee/app/asm/fix/threadpool/global/j;

    .line 7
    invoke-virtual {p0, p1}, Lcom/shopee/app/asm/anr/threadpool/b;->execute(Ljava/lang/Runnable;)V

    return-void

    .line 8
    :cond_2b
    invoke-interface {p0, p1}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
    :try_end_2e
    .catchall {:try_start_1f .. :try_end_2e} :catchall_2f

    goto :goto_54

    :catchall_2f
    move-exception p0

    .line 9
    sget-object p1, Lcom/shopee/app/asm/anr/threadpool/c;->a:Landroid/os/HandlerThread;

    .line 10
    invoke-static {}, Lcom/shopee/app/apm/c;->d()Lcom/shopee/app/apm/nonfatal/a;

    move-result-object p1

    invoke-virtual {p1, p0}, Lcom/shopee/app/apm/nonfatal/a;->c(Ljava/lang/Throwable;)V

    goto :goto_54

    .line 11
    :cond_3a
    :try_start_3a
    invoke-static {p1, p0}, Lcom/shopee/app/asm/anr/threadpool/a;->a(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_46

    .line 12
    sget-object p0, Lcom/shopee/app/asm/fix/threadpool/global/i;->e:Lcom/shopee/app/asm/fix/threadpool/global/j;

    .line 13
    invoke-virtual {p0, p1}, Lcom/shopee/app/asm/anr/threadpool/b;->execute(Ljava/lang/Runnable;)V

    return-void

    .line 14
    :cond_46
    invoke-interface {p0, p1}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
    :try_end_49
    .catchall {:try_start_3a .. :try_end_49} :catchall_4a

    goto :goto_54

    :catchall_4a
    move-exception p0

    .line 15
    sget-object p1, Lcom/shopee/app/asm/anr/threadpool/c;->a:Landroid/os/HandlerThread;

    .line 16
    invoke-static {}, Lcom/shopee/app/apm/c;->d()Lcom/shopee/app/apm/nonfatal/a;

    move-result-object p1

    invoke-virtual {p1, p0}, Lcom/shopee/app/apm/nonfatal/a;->c(Ljava/lang/Throwable;)V

    :goto_54
    return-void
.end method


# virtual methods
.method public execute()V
    .registers 6

    .line 1
    iget-object v0, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    iget-object v0, v0, Lokhttp3/RealCall;->timeout:Lokio/a;

    invoke-virtual {v0}, Lokio/a;->enter()V

    const/4 v0, 0x0

    .line 2
    :try_start_8
    iget-object v1, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    invoke-virtual {v1}, Lokhttp3/RealCall;->getResponseWithInterceptorChain()Lokhttp3/Response;

    move-result-object v0
    :try_end_e
    .catch Ljava/io/IOException; {:try_start_8 .. :try_end_e} :catch_26
    .catchall {:try_start_8 .. :try_end_e} :catchall_24

    const/4 v1, 0x1

    .line 3
    :try_start_f
    iget-object v2, p0, Lokhttp3/RealCall$AsyncCall;->responseCallback:Lokhttp3/Callback;

    iget-object v3, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    invoke-interface {v2, v3, v0}, Lokhttp3/Callback;->onResponse(Lokhttp3/Call;Lokhttp3/Response;)V
    :try_end_16
    .catch Ljava/io/IOException; {:try_start_f .. :try_end_16} :catch_22
    .catchall {:try_start_f .. :try_end_16} :catchall_24

    .line 4
    :goto_16
    iget-object v0, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    iget-object v0, v0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;

    invoke-virtual {v0}, Lokhttp3/OkHttpClient;->dispatcher()Lokhttp3/Dispatcher;

    move-result-object v0

    invoke-virtual {v0, p0}, Lokhttp3/Dispatcher;->finished(Lokhttp3/RealCall$AsyncCall;)V

    goto :goto_64

    :catch_22
    move-exception v0

    goto :goto_29

    :catchall_24
    move-exception v0

    goto :goto_65

    :catch_26
    move-exception v1

    move-object v0, v1

    const/4 v1, 0x0

    .line 5
    :goto_29
    :try_start_29
    iget-object v2, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    invoke-virtual {v2, v0}, Lokhttp3/RealCall;->timeoutExit(Ljava/io/IOException;)Ljava/io/IOException;

    move-result-object v0

    if-eqz v1, :cond_51

    .line 6
    invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;

    move-result-object v1

    const/4 v2, 0x4

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Callback failure for "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v4, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    invoke-virtual {v4}, Lokhttp3/RealCall;->toLoggableString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3, v0}, Lokhttp3/internal/platform/Platform;->log(ILjava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_16

    .line 7
    :cond_51
    iget-object v1, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    # getter for: Lokhttp3/RealCall;->eventListener:Lokhttp3/EventListener;
    invoke-static {v1}, Lokhttp3/RealCall;->access$000(Lokhttp3/RealCall;)Lokhttp3/EventListener;

    move-result-object v1

    iget-object v2, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    invoke-virtual {v1, v2, v0}, Lokhttp3/EventListener;->callFailed(Lokhttp3/Call;Ljava/io/IOException;)V

    .line 8
    iget-object v1, p0, Lokhttp3/RealCall$AsyncCall;->responseCallback:Lokhttp3/Callback;

    iget-object v2, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    invoke-interface {v1, v2, v0}, Lokhttp3/Callback;->onFailure(Lokhttp3/Call;Ljava/io/IOException;)V
    :try_end_63
    .catchall {:try_start_29 .. :try_end_63} :catchall_24

    goto :goto_16

    :goto_64
    return-void

    .line 9
    :goto_65
    iget-object v1, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    iget-object v1, v1, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;

    invoke-virtual {v1}, Lokhttp3/OkHttpClient;->dispatcher()Lokhttp3/Dispatcher;

    move-result-object v1

    invoke-virtual {v1, p0}, Lokhttp3/Dispatcher;->finished(Lokhttp3/RealCall$AsyncCall;)V

    .line 10
    throw v0
.end method

.method public executeOn(Ljava/util/concurrent/ExecutorService;)V
    .registers 4

    .line 1
    :try_start_0
    invoke-static {p1, p0}, Lokhttp3/RealCall$AsyncCall;->INVOKEINTERFACE_okhttp3_RealCall$AsyncCall_com_shopee_app_asm_anr_threadpool_ExecutorProxy_execute(Ljava/util/concurrent/ExecutorService;Ljava/lang/Runnable;)V
    :try_end_3
    .catch Ljava/util/concurrent/RejectedExecutionException; {:try_start_0 .. :try_end_3} :catch_6
    .catchall {:try_start_0 .. :try_end_3} :catchall_4

    goto :goto_2e

    :catchall_4
    move-exception p1

    goto :goto_2f

    :catch_6
    move-exception p1

    .line 2
    :try_start_7
    new-instance v0, Ljava/io/InterruptedIOException;

    const-string v1, "executor rejected"

    invoke-direct {v0, v1}, Ljava/io/InterruptedIOException;-><init>(Ljava/lang/String;)V

    .line 3
    invoke-virtual {v0, p1}, Ljava/lang/Throwable;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;

    .line 4
    iget-object p1, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    # getter for: Lokhttp3/RealCall;->eventListener:Lokhttp3/EventListener;
    invoke-static {p1}, Lokhttp3/RealCall;->access$000(Lokhttp3/RealCall;)Lokhttp3/EventListener;

    move-result-object p1

    iget-object v1, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    invoke-virtual {p1, v1, v0}, Lokhttp3/EventListener;->callFailed(Lokhttp3/Call;Ljava/io/IOException;)V

    .line 5
    iget-object p1, p0, Lokhttp3/RealCall$AsyncCall;->responseCallback:Lokhttp3/Callback;

    iget-object v1, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    invoke-interface {p1, v1, v0}, Lokhttp3/Callback;->onFailure(Lokhttp3/Call;Ljava/io/IOException;)V
    :try_end_23
    .catchall {:try_start_7 .. :try_end_23} :catchall_4

    .line 6
    iget-object p1, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    iget-object p1, p1, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;

    invoke-virtual {p1}, Lokhttp3/OkHttpClient;->dispatcher()Lokhttp3/Dispatcher;

    move-result-object p1

    invoke-virtual {p1, p0}, Lokhttp3/Dispatcher;->finished(Lokhttp3/RealCall$AsyncCall;)V

    :goto_2e
    return-void

    :goto_2f
    iget-object v0, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    iget-object v0, v0, Lokhttp3/RealCall;->client:Lokhttp3/OkHttpClient;

    invoke-virtual {v0}, Lokhttp3/OkHttpClient;->dispatcher()Lokhttp3/Dispatcher;

    move-result-object v0

    invoke-virtual {v0, p0}, Lokhttp3/Dispatcher;->finished(Lokhttp3/RealCall$AsyncCall;)V

    .line 7
    throw p1
.end method

.method public get()Lokhttp3/RealCall;
    .registers 2

    iget-object v0, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    return-object v0
.end method

.method public host()Ljava/lang/String;
    .registers 2

    iget-object v0, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    iget-object v0, v0, Lokhttp3/RealCall;->originalRequest:Lokhttp3/Request;

    invoke-virtual {v0}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;

    move-result-object v0

    invoke-virtual {v0}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public request()Lokhttp3/Request;
    .registers 2

    iget-object v0, p0, Lokhttp3/RealCall$AsyncCall;->this$0:Lokhttp3/RealCall;

    iget-object v0, v0, Lokhttp3/RealCall;->originalRequest:Lokhttp3/Request;

    return-object v0
.end method