430 lines
9.5 KiB
Smali
430 lines
9.5 KiB
Smali
.class public final Lsh/i;
|
|
.super Ljava/util/concurrent/CountDownLatch;
|
|
.source "FutureSingleObserver.java"
|
|
|
|
# interfaces
|
|
.implements Lkh/l0;
|
|
.implements Ljava/util/concurrent/Future;
|
|
.implements Lio/reactivex/disposables/b;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">",
|
|
"Ljava/util/concurrent/CountDownLatch;",
|
|
"Lkh/l0<",
|
|
"TT;>;",
|
|
"Ljava/util/concurrent/Future<",
|
|
"TT;>;",
|
|
"Lio/reactivex/disposables/b;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public a:Ljava/lang/Object;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"TT;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public b:Ljava/lang/Throwable;
|
|
|
|
.field public final c:Ljava/util/concurrent/atomic/AtomicReference;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/concurrent/atomic/AtomicReference<",
|
|
"Lio/reactivex/disposables/b;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 1
|
|
invoke-direct {p0, v0}, Ljava/util/concurrent/CountDownLatch;-><init>(I)V
|
|
|
|
.line 2
|
|
new-instance v0, Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicReference;-><init>()V
|
|
|
|
iput-object v0, p0, Lsh/i;->c:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public cancel(Z)Z
|
|
.locals 2
|
|
|
|
.line 1
|
|
:cond_0
|
|
iget-object p1, p0, Lsh/i;->c:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-virtual {p1}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lio/reactivex/disposables/b;
|
|
|
|
if-eq p1, p0, :cond_3
|
|
|
|
.line 2
|
|
sget-object v0, Lio/reactivex/internal/disposables/DisposableHelper;->DISPOSED:Lio/reactivex/internal/disposables/DisposableHelper;
|
|
|
|
if-ne p1, v0, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
.line 3
|
|
:cond_1
|
|
iget-object v1, p0, Lsh/i;->c:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-virtual {v1, p1, v0}, Ljava/util/concurrent/atomic/AtomicReference;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
.line 4
|
|
invoke-interface {p1}, Lio/reactivex/disposables/b;->dispose()V
|
|
|
|
.line 5
|
|
:cond_2
|
|
invoke-virtual {p0}, Ljava/util/concurrent/CountDownLatch;->countDown()V
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
|
|
:cond_3
|
|
:goto_0
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public dispose()V
|
|
.locals 0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public get()Ljava/lang/Object;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()TT;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/InterruptedException;,
|
|
Ljava/util/concurrent/ExecutionException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-virtual {p0}, Ljava/util/concurrent/CountDownLatch;->getCount()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long v0, v0, v2
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
invoke-static {}, Lio/reactivex/internal/util/c;->b()V
|
|
|
|
.line 3
|
|
invoke-virtual {p0}, Ljava/util/concurrent/CountDownLatch;->await()V
|
|
|
|
.line 4
|
|
:cond_0
|
|
invoke-virtual {p0}, Lsh/i;->isCancelled()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
.line 5
|
|
iget-object v0, p0, Lsh/i;->b:Ljava/lang/Throwable;
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
.line 6
|
|
iget-object v0, p0, Lsh/i;->a:Ljava/lang/Object;
|
|
|
|
return-object v0
|
|
|
|
.line 7
|
|
:cond_1
|
|
new-instance v1, Ljava/util/concurrent/ExecutionException;
|
|
|
|
invoke-direct {v1, v0}, Ljava/util/concurrent/ExecutionException;-><init>(Ljava/lang/Throwable;)V
|
|
|
|
throw v1
|
|
|
|
.line 8
|
|
:cond_2
|
|
new-instance v0, Ljava/util/concurrent/CancellationException;
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/CancellationException;-><init>()V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public get(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J",
|
|
"Ljava/util/concurrent/TimeUnit;",
|
|
")TT;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/InterruptedException;,
|
|
Ljava/util/concurrent/ExecutionException;,
|
|
Ljava/util/concurrent/TimeoutException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 9
|
|
invoke-virtual {p0}, Ljava/util/concurrent/CountDownLatch;->getCount()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long v0, v0, v2
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 10
|
|
invoke-static {}, Lio/reactivex/internal/util/c;->b()V
|
|
|
|
.line 11
|
|
invoke-virtual {p0, p1, p2, p3}, Ljava/util/concurrent/CountDownLatch;->await(JLjava/util/concurrent/TimeUnit;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 12
|
|
:cond_0
|
|
new-instance v0, Ljava/util/concurrent/TimeoutException;
|
|
|
|
invoke-static {p1, p2, p3}, Lio/reactivex/internal/util/ExceptionHelper;->e(JLjava/util/concurrent/TimeUnit;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v0, p1}, Ljava/util/concurrent/TimeoutException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
.line 13
|
|
:cond_1
|
|
:goto_0
|
|
invoke-virtual {p0}, Lsh/i;->isCancelled()Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_3
|
|
|
|
.line 14
|
|
iget-object p1, p0, Lsh/i;->b:Ljava/lang/Throwable;
|
|
|
|
if-nez p1, :cond_2
|
|
|
|
.line 15
|
|
iget-object p1, p0, Lsh/i;->a:Ljava/lang/Object;
|
|
|
|
return-object p1
|
|
|
|
.line 16
|
|
:cond_2
|
|
new-instance p2, Ljava/util/concurrent/ExecutionException;
|
|
|
|
invoke-direct {p2, p1}, Ljava/util/concurrent/ExecutionException;-><init>(Ljava/lang/Throwable;)V
|
|
|
|
throw p2
|
|
|
|
.line 17
|
|
:cond_3
|
|
new-instance p1, Ljava/util/concurrent/CancellationException;
|
|
|
|
invoke-direct {p1}, Ljava/util/concurrent/CancellationException;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public isCancelled()Z
|
|
.locals 1
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lsh/i;->c:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lio/reactivex/disposables/b;
|
|
|
|
invoke-static {v0}, Lio/reactivex/internal/disposables/DisposableHelper;->isDisposed(Lio/reactivex/disposables/b;)Z
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public isDisposed()Z
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-virtual {p0}, Lsh/i;->isDone()Z
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public isDone()Z
|
|
.locals 4
|
|
|
|
.line 1
|
|
invoke-virtual {p0}, Ljava/util/concurrent/CountDownLatch;->getCount()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long v0, v0, v2
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public onError(Ljava/lang/Throwable;)V
|
|
.locals 2
|
|
|
|
.line 1
|
|
:cond_0
|
|
iget-object v0, p0, Lsh/i;->c:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lio/reactivex/disposables/b;
|
|
|
|
.line 2
|
|
sget-object v1, Lio/reactivex/internal/disposables/DisposableHelper;->DISPOSED:Lio/reactivex/internal/disposables/DisposableHelper;
|
|
|
|
if-ne v0, v1, :cond_1
|
|
|
|
.line 3
|
|
invoke-static {p1}, Lwh/a;->Y(Ljava/lang/Throwable;)V
|
|
|
|
return-void
|
|
|
|
.line 4
|
|
:cond_1
|
|
iput-object p1, p0, Lsh/i;->b:Ljava/lang/Throwable;
|
|
|
|
.line 5
|
|
iget-object v1, p0, Lsh/i;->c:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-virtual {v1, v0, p0}, Ljava/util/concurrent/atomic/AtomicReference;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 6
|
|
invoke-virtual {p0}, Ljava/util/concurrent/CountDownLatch;->countDown()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onSubscribe(Lio/reactivex/disposables/b;)V
|
|
.locals 1
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lsh/i;->c:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-static {v0, p1}, Lio/reactivex/internal/disposables/DisposableHelper;->setOnce(Ljava/util/concurrent/atomic/AtomicReference;Lio/reactivex/disposables/b;)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onSuccess(Ljava/lang/Object;)V
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(TT;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lsh/i;->c:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lio/reactivex/disposables/b;
|
|
|
|
.line 2
|
|
sget-object v1, Lio/reactivex/internal/disposables/DisposableHelper;->DISPOSED:Lio/reactivex/internal/disposables/DisposableHelper;
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 3
|
|
:cond_0
|
|
iput-object p1, p0, Lsh/i;->a:Ljava/lang/Object;
|
|
|
|
.line 4
|
|
iget-object p1, p0, Lsh/i;->c:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-virtual {p1, v0, p0}, Ljava/util/concurrent/atomic/AtomicReference;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
.line 5
|
|
invoke-virtual {p0}, Ljava/util/concurrent/CountDownLatch;->countDown()V
|
|
|
|
return-void
|
|
.end method
|