592 lines
12 KiB
Smali
592 lines
12 KiB
Smali
|
.class public final Lm0/q;
|
||
|
.super Ljava/lang/Object;
|
||
|
.source "Dispatcher.kt"
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field public a:I
|
||
|
|
||
|
.field public b:I
|
||
|
|
||
|
.field public c:Ljava/util/concurrent/ExecutorService;
|
||
|
|
||
|
.field public final d:Ljava/util/ArrayDeque;
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"Ljava/util/ArrayDeque<",
|
||
|
"Lm0/z$a;",
|
||
|
">;"
|
||
|
}
|
||
|
.end annotation
|
||
|
.end field
|
||
|
|
||
|
.field public final e:Ljava/util/ArrayDeque;
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"Ljava/util/ArrayDeque<",
|
||
|
"Lm0/z$a;",
|
||
|
">;"
|
||
|
}
|
||
|
.end annotation
|
||
|
.end field
|
||
|
|
||
|
.field public final f:Ljava/util/ArrayDeque;
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"Ljava/util/ArrayDeque<",
|
||
|
"Lm0/z;",
|
||
|
">;"
|
||
|
}
|
||
|
.end annotation
|
||
|
.end field
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method public constructor <init>()V
|
||
|
.locals 1
|
||
|
|
||
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||
|
|
||
|
const/16 v0, 0x40
|
||
|
|
||
|
iput v0, p0, Lm0/q;->a:I
|
||
|
|
||
|
const/4 v0, 0x5
|
||
|
|
||
|
iput v0, p0, Lm0/q;->b:I
|
||
|
|
||
|
new-instance v0, Ljava/util/ArrayDeque;
|
||
|
|
||
|
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
|
||
|
|
||
|
iput-object v0, p0, Lm0/q;->d:Ljava/util/ArrayDeque;
|
||
|
|
||
|
new-instance v0, Ljava/util/ArrayDeque;
|
||
|
|
||
|
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
|
||
|
|
||
|
iput-object v0, p0, Lm0/q;->e:Ljava/util/ArrayDeque;
|
||
|
|
||
|
new-instance v0, Ljava/util/ArrayDeque;
|
||
|
|
||
|
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
|
||
|
|
||
|
iput-object v0, p0, Lm0/q;->f:Ljava/util/ArrayDeque;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public final declared-synchronized a()V
|
||
|
.locals 2
|
||
|
|
||
|
monitor-enter p0
|
||
|
|
||
|
:try_start_0
|
||
|
iget-object v0, p0, Lm0/q;->d:Ljava/util/ArrayDeque;
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
:goto_0
|
||
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-eqz v1, :cond_0
|
||
|
|
||
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
check-cast v1, Lm0/z$a;
|
||
|
|
||
|
iget-object v1, v1, Lm0/z$a;->f:Lm0/z;
|
||
|
|
||
|
invoke-virtual {v1}, Lm0/z;->cancel()V
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_0
|
||
|
iget-object v0, p0, Lm0/q;->e:Ljava/util/ArrayDeque;
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
:goto_1
|
||
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-eqz v1, :cond_1
|
||
|
|
||
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
check-cast v1, Lm0/z$a;
|
||
|
|
||
|
iget-object v1, v1, Lm0/z$a;->f:Lm0/z;
|
||
|
|
||
|
invoke-virtual {v1}, Lm0/z;->cancel()V
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
:cond_1
|
||
|
iget-object v0, p0, Lm0/q;->f:Ljava/util/ArrayDeque;
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
:goto_2
|
||
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-eqz v1, :cond_2
|
||
|
|
||
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
check-cast v1, Lm0/z;
|
||
|
|
||
|
invoke-virtual {v1}, Lm0/z;->cancel()V
|
||
|
:try_end_0
|
||
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
||
|
|
||
|
goto :goto_2
|
||
|
|
||
|
:cond_2
|
||
|
monitor-exit p0
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:catchall_0
|
||
|
move-exception v0
|
||
|
|
||
|
monitor-exit p0
|
||
|
|
||
|
throw v0
|
||
|
.end method
|
||
|
|
||
|
.method public final b(Ljava/util/Deque;Ljava/lang/Object;)V
|
||
|
.locals 0
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"<T:",
|
||
|
"Ljava/lang/Object;",
|
||
|
">(",
|
||
|
"Ljava/util/Deque<",
|
||
|
"TT;>;TT;)V"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
monitor-enter p0
|
||
|
|
||
|
:try_start_0
|
||
|
invoke-interface {p1, p2}, Ljava/util/Deque;->remove(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result p1
|
||
|
:try_end_0
|
||
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
||
|
|
||
|
if-eqz p1, :cond_0
|
||
|
|
||
|
monitor-exit p0
|
||
|
|
||
|
invoke-virtual {p0}, Lm0/q;->d()Z
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:cond_0
|
||
|
:try_start_1
|
||
|
new-instance p1, Ljava/lang/AssertionError;
|
||
|
|
||
|
const-string p2, "Call wasn\'t in-flight!"
|
||
|
|
||
|
invoke-direct {p1, p2}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
|
||
|
|
||
|
throw p1
|
||
|
:try_end_1
|
||
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
||
|
|
||
|
:catchall_0
|
||
|
move-exception p1
|
||
|
|
||
|
monitor-exit p0
|
||
|
|
||
|
throw p1
|
||
|
.end method
|
||
|
|
||
|
.method public final c(Lm0/z$a;)V
|
||
|
.locals 1
|
||
|
|
||
|
iget-object v0, p1, Lm0/z$a;->d:Ljava/util/concurrent/atomic/AtomicInteger;
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicInteger;->decrementAndGet()I
|
||
|
|
||
|
iget-object v0, p0, Lm0/q;->e:Ljava/util/ArrayDeque;
|
||
|
|
||
|
invoke-virtual {p0, v0, p1}, Lm0/q;->b(Ljava/util/Deque;Ljava/lang/Object;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public final d()Z
|
||
|
.locals 17
|
||
|
|
||
|
move-object/from16 v1, p0
|
||
|
|
||
|
invoke-static/range {p0 .. p0}, Ljava/lang/Thread;->holdsLock(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
const/4 v2, 0x1
|
||
|
|
||
|
xor-int/2addr v0, v2
|
||
|
|
||
|
sget-boolean v3, Li0/h;->a:Z
|
||
|
|
||
|
if-eqz v3, :cond_1
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_0
|
||
|
const-string v0, "Assertion failed"
|
||
|
|
||
|
new-instance v2, Ljava/lang/AssertionError;
|
||
|
|
||
|
invoke-direct {v2, v0}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
|
||
|
|
||
|
throw v2
|
||
|
|
||
|
:cond_1
|
||
|
:goto_0
|
||
|
new-instance v3, Ljava/util/ArrayList;
|
||
|
|
||
|
invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V
|
||
|
|
||
|
monitor-enter p0
|
||
|
|
||
|
:try_start_0
|
||
|
iget-object v0, v1, Lm0/q;->d:Ljava/util/ArrayDeque;
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
const-string v4, "readyAsyncCalls.iterator()"
|
||
|
|
||
|
invoke-static {v0, v4}, Li0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
||
|
|
||
|
:goto_1
|
||
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v4
|
||
|
|
||
|
if-eqz v4, :cond_4
|
||
|
|
||
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
check-cast v4, Lm0/z$a;
|
||
|
|
||
|
iget-object v5, v1, Lm0/q;->e:Ljava/util/ArrayDeque;
|
||
|
|
||
|
invoke-virtual {v5}, Ljava/util/ArrayDeque;->size()I
|
||
|
|
||
|
move-result v5
|
||
|
|
||
|
iget v6, v1, Lm0/q;->a:I
|
||
|
|
||
|
if-lt v5, v6, :cond_2
|
||
|
|
||
|
goto :goto_2
|
||
|
|
||
|
:cond_2
|
||
|
iget-object v5, v4, Lm0/z$a;->d:Ljava/util/concurrent/atomic/AtomicInteger;
|
||
|
|
||
|
invoke-virtual {v5}, Ljava/util/concurrent/atomic/AtomicInteger;->get()I
|
||
|
|
||
|
move-result v5
|
||
|
|
||
|
iget v6, v1, Lm0/q;->b:I
|
||
|
|
||
|
if-lt v5, v6, :cond_3
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
:cond_3
|
||
|
invoke-interface {v0}, Ljava/util/Iterator;->remove()V
|
||
|
|
||
|
iget-object v5, v4, Lm0/z$a;->d:Ljava/util/concurrent/atomic/AtomicInteger;
|
||
|
|
||
|
invoke-virtual {v5}, Ljava/util/concurrent/atomic/AtomicInteger;->incrementAndGet()I
|
||
|
|
||
|
const-string v5, "asyncCall"
|
||
|
|
||
|
invoke-static {v4, v5}, Li0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
||
|
|
||
|
invoke-interface {v3, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
||
|
|
||
|
iget-object v5, v1, Lm0/q;->e:Ljava/util/ArrayDeque;
|
||
|
|
||
|
invoke-virtual {v5, v4}, Ljava/util/ArrayDeque;->add(Ljava/lang/Object;)Z
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
:cond_4
|
||
|
:goto_2
|
||
|
monitor-enter p0
|
||
|
:try_end_0
|
||
|
.catchall {:try_start_0 .. :try_end_0} :catchall_3
|
||
|
|
||
|
:try_start_1
|
||
|
iget-object v0, v1, Lm0/q;->e:Ljava/util/ArrayDeque;
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/util/ArrayDeque;->size()I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
iget-object v4, v1, Lm0/q;->f:Ljava/util/ArrayDeque;
|
||
|
|
||
|
invoke-virtual {v4}, Ljava/util/ArrayDeque;->size()I
|
||
|
|
||
|
move-result v4
|
||
|
:try_end_1
|
||
|
.catchall {:try_start_1 .. :try_end_1} :catchall_2
|
||
|
|
||
|
add-int/2addr v0, v4
|
||
|
|
||
|
:try_start_2
|
||
|
monitor-exit p0
|
||
|
:try_end_2
|
||
|
.catchall {:try_start_2 .. :try_end_2} :catchall_3
|
||
|
|
||
|
const/4 v4, 0x0
|
||
|
|
||
|
if-lez v0, :cond_5
|
||
|
|
||
|
const/4 v5, 0x1
|
||
|
|
||
|
goto :goto_3
|
||
|
|
||
|
:cond_5
|
||
|
const/4 v5, 0x0
|
||
|
|
||
|
:goto_3
|
||
|
monitor-exit p0
|
||
|
|
||
|
invoke-interface {v3}, Ljava/util/List;->size()I
|
||
|
|
||
|
move-result v6
|
||
|
|
||
|
const/4 v7, 0x0
|
||
|
|
||
|
:goto_4
|
||
|
if-ge v7, v6, :cond_b
|
||
|
|
||
|
invoke-interface {v3, v7}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
move-object v8, v0
|
||
|
|
||
|
check-cast v8, Lm0/z$a;
|
||
|
|
||
|
monitor-enter p0
|
||
|
|
||
|
:try_start_3
|
||
|
iget-object v0, v1, Lm0/q;->c:Ljava/util/concurrent/ExecutorService;
|
||
|
|
||
|
if-nez v0, :cond_6
|
||
|
|
||
|
new-instance v0, Ljava/util/concurrent/ThreadPoolExecutor;
|
||
|
|
||
|
const/4 v10, 0x0
|
||
|
|
||
|
const v11, 0x7fffffff
|
||
|
|
||
|
const-wide/16 v12, 0x3c
|
||
|
|
||
|
sget-object v14, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
|
||
|
|
||
|
new-instance v15, Ljava/util/concurrent/SynchronousQueue;
|
||
|
|
||
|
invoke-direct {v15}, Ljava/util/concurrent/SynchronousQueue;-><init>()V
|
||
|
|
||
|
const-string v9, "OkHttp Dispatcher"
|
||
|
|
||
|
invoke-static {v9, v4}, Lm0/g0/b;->A(Ljava/lang/String;Z)Ljava/util/concurrent/ThreadFactory;
|
||
|
|
||
|
move-result-object v16
|
||
|
|
||
|
move-object v9, v0
|
||
|
|
||
|
invoke-direct/range {v9 .. v16}, Ljava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;)V
|
||
|
|
||
|
iput-object v0, v1, Lm0/q;->c:Ljava/util/concurrent/ExecutorService;
|
||
|
|
||
|
:cond_6
|
||
|
iget-object v0, v1, Lm0/q;->c:Ljava/util/concurrent/ExecutorService;
|
||
|
:try_end_3
|
||
|
.catchall {:try_start_3 .. :try_end_3} :catchall_1
|
||
|
|
||
|
const/4 v9, 0x0
|
||
|
|
||
|
if-eqz v0, :cond_a
|
||
|
|
||
|
monitor-exit p0
|
||
|
|
||
|
iget-object v10, v8, Lm0/z$a;->f:Lm0/z;
|
||
|
|
||
|
iget-object v10, v10, Lm0/z;->f:Lm0/x;
|
||
|
|
||
|
iget-object v10, v10, Lm0/x;->d:Lm0/q;
|
||
|
|
||
|
invoke-static {v10}, Ljava/lang/Thread;->holdsLock(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v10
|
||
|
|
||
|
xor-int/2addr v10, v2
|
||
|
|
||
|
sget-boolean v11, Li0/h;->a:Z
|
||
|
|
||
|
if-eqz v11, :cond_8
|
||
|
|
||
|
if-eqz v10, :cond_7
|
||
|
|
||
|
goto :goto_5
|
||
|
|
||
|
:cond_7
|
||
|
new-instance v0, Ljava/lang/AssertionError;
|
||
|
|
||
|
const-string v2, "Assertion failed"
|
||
|
|
||
|
invoke-direct {v0, v2}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
|
||
|
|
||
|
throw v0
|
||
|
|
||
|
:cond_8
|
||
|
:goto_5
|
||
|
:try_start_4
|
||
|
invoke-interface {v0, v8}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
|
||
|
:try_end_4
|
||
|
.catch Ljava/util/concurrent/RejectedExecutionException; {:try_start_4 .. :try_end_4} :catch_0
|
||
|
.catchall {:try_start_4 .. :try_end_4} :catchall_0
|
||
|
|
||
|
goto :goto_6
|
||
|
|
||
|
:catchall_0
|
||
|
move-exception v0
|
||
|
|
||
|
goto :goto_7
|
||
|
|
||
|
:catch_0
|
||
|
move-exception v0
|
||
|
|
||
|
move-object v10, v0
|
||
|
|
||
|
:try_start_5
|
||
|
new-instance v0, Ljava/io/InterruptedIOException;
|
||
|
|
||
|
const-string v11, "executor rejected"
|
||
|
|
||
|
invoke-direct {v0, v11}, Ljava/io/InterruptedIOException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
invoke-virtual {v0, v10}, Ljava/io/InterruptedIOException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;
|
||
|
|
||
|
iget-object v10, v8, Lm0/z$a;->f:Lm0/z;
|
||
|
|
||
|
iget-object v10, v10, Lm0/z;->d:Lm0/g0/d/m;
|
||
|
|
||
|
if-eqz v10, :cond_9
|
||
|
|
||
|
invoke-virtual {v10, v0}, Lm0/g0/d/m;->h(Ljava/io/IOException;)Ljava/io/IOException;
|
||
|
|
||
|
iget-object v9, v8, Lm0/z$a;->e:Lm0/g;
|
||
|
|
||
|
iget-object v10, v8, Lm0/z$a;->f:Lm0/z;
|
||
|
|
||
|
invoke-interface {v9, v10, v0}, Lm0/g;->b(Lm0/f;Ljava/io/IOException;)V
|
||
|
:try_end_5
|
||
|
.catchall {:try_start_5 .. :try_end_5} :catchall_0
|
||
|
|
||
|
iget-object v0, v8, Lm0/z$a;->f:Lm0/z;
|
||
|
|
||
|
iget-object v0, v0, Lm0/z;->f:Lm0/x;
|
||
|
|
||
|
iget-object v0, v0, Lm0/x;->d:Lm0/q;
|
||
|
|
||
|
invoke-virtual {v0, v8}, Lm0/q;->c(Lm0/z$a;)V
|
||
|
|
||
|
:goto_6
|
||
|
add-int/lit8 v7, v7, 0x1
|
||
|
|
||
|
goto :goto_4
|
||
|
|
||
|
:cond_9
|
||
|
:try_start_6
|
||
|
const-string v0, "transmitter"
|
||
|
|
||
|
invoke-static {v0}, Li0/n/c/h;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
||
|
:try_end_6
|
||
|
.catchall {:try_start_6 .. :try_end_6} :catchall_0
|
||
|
|
||
|
throw v9
|
||
|
|
||
|
:goto_7
|
||
|
iget-object v2, v8, Lm0/z$a;->f:Lm0/z;
|
||
|
|
||
|
iget-object v2, v2, Lm0/z;->f:Lm0/x;
|
||
|
|
||
|
iget-object v2, v2, Lm0/x;->d:Lm0/q;
|
||
|
|
||
|
invoke-virtual {v2, v8}, Lm0/q;->c(Lm0/z$a;)V
|
||
|
|
||
|
throw v0
|
||
|
|
||
|
:cond_a
|
||
|
:try_start_7
|
||
|
invoke-static {}, Li0/n/c/h;->throwNpe()V
|
||
|
:try_end_7
|
||
|
.catchall {:try_start_7 .. :try_end_7} :catchall_1
|
||
|
|
||
|
throw v9
|
||
|
|
||
|
:catchall_1
|
||
|
move-exception v0
|
||
|
|
||
|
monitor-exit p0
|
||
|
|
||
|
throw v0
|
||
|
|
||
|
:cond_b
|
||
|
return v5
|
||
|
|
||
|
:catchall_2
|
||
|
move-exception v0
|
||
|
|
||
|
:try_start_8
|
||
|
monitor-exit p0
|
||
|
|
||
|
throw v0
|
||
|
:try_end_8
|
||
|
.catchall {:try_start_8 .. :try_end_8} :catchall_3
|
||
|
|
||
|
:catchall_3
|
||
|
move-exception v0
|
||
|
|
||
|
monitor-exit p0
|
||
|
|
||
|
throw v0
|
||
|
.end method
|