527 lines
11 KiB
Smali
527 lines
11 KiB
Smali
.class final Lrx/internal/a/ai$a;
|
|
.super Lrx/Subscriber;
|
|
.source "OperatorObserveOn.java"
|
|
|
|
# interfaces
|
|
.implements Lrx/functions/Action0;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lrx/internal/a/ai;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x18
|
|
name = "a"
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">",
|
|
"Lrx/Subscriber<",
|
|
"TT;>;",
|
|
"Lrx/functions/Action0;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field final bFj:Lrx/Scheduler$Worker;
|
|
|
|
.field final bFk:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
.field bFl:J
|
|
|
|
.field volatile bsH:Z
|
|
|
|
.field final child:Lrx/Subscriber;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/Subscriber<",
|
|
"-TT;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field final delayError:Z
|
|
|
|
.field error:Ljava/lang/Throwable;
|
|
|
|
.field final limit:I
|
|
|
|
.field final queue:Ljava/util/Queue;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Queue<",
|
|
"Ljava/lang/Object;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field final requested:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lrx/Scheduler;Lrx/Subscriber;ZI)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lrx/Scheduler;",
|
|
"Lrx/Subscriber<",
|
|
"-TT;>;ZI)V"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Lrx/Subscriber;-><init>()V
|
|
|
|
new-instance v0, Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicLong;-><init>()V
|
|
|
|
iput-object v0, p0, Lrx/internal/a/ai$a;->requested:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
new-instance v0, Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicLong;-><init>()V
|
|
|
|
iput-object v0, p0, Lrx/internal/a/ai$a;->bFk:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
iput-object p2, p0, Lrx/internal/a/ai$a;->child:Lrx/Subscriber;
|
|
|
|
invoke-virtual {p1}, Lrx/Scheduler;->DK()Lrx/Scheduler$Worker;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lrx/internal/a/ai$a;->bFj:Lrx/Scheduler$Worker;
|
|
|
|
iput-boolean p3, p0, Lrx/internal/a/ai$a;->delayError:Z
|
|
|
|
if-lez p4, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
sget p4, Lrx/internal/util/i;->SIZE:I
|
|
|
|
:goto_0
|
|
shr-int/lit8 p1, p4, 0x2
|
|
|
|
sub-int p1, p4, p1
|
|
|
|
iput p1, p0, Lrx/internal/a/ai$a;->limit:I
|
|
|
|
invoke-static {}, Lrx/internal/util/b/ae;->EM()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
new-instance p1, Lrx/internal/util/b/q;
|
|
|
|
invoke-direct {p1, p4}, Lrx/internal/util/b/q;-><init>(I)V
|
|
|
|
iput-object p1, p0, Lrx/internal/a/ai$a;->queue:Ljava/util/Queue;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
new-instance p1, Lrx/internal/util/a/d;
|
|
|
|
invoke-direct {p1, p4}, Lrx/internal/util/a/d;-><init>(I)V
|
|
|
|
iput-object p1, p0, Lrx/internal/a/ai$a;->queue:Ljava/util/Queue;
|
|
|
|
:goto_1
|
|
int-to-long p1, p4
|
|
|
|
invoke-virtual {p0, p1, p2}, Lrx/internal/a/ai$a;->request(J)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(ZZLrx/Subscriber;Ljava/util/Queue;)Z
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(ZZ",
|
|
"Lrx/Subscriber<",
|
|
"-TT;>;",
|
|
"Ljava/util/Queue<",
|
|
"Ljava/lang/Object;",
|
|
">;)Z"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p3}, Lrx/Subscriber;->isUnsubscribed()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-interface {p4}, Ljava/util/Queue;->clear()V
|
|
|
|
return v1
|
|
|
|
:cond_0
|
|
if-eqz p1, :cond_4
|
|
|
|
iget-boolean p1, p0, Lrx/internal/a/ai$a;->delayError:Z
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
if-eqz p2, :cond_4
|
|
|
|
iget-object p1, p0, Lrx/internal/a/ai$a;->error:Ljava/lang/Throwable;
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
:try_start_0
|
|
invoke-virtual {p3, p1}, Lrx/Subscriber;->onError(Ljava/lang/Throwable;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-virtual {p3}, Lrx/Subscriber;->onCompleted()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:goto_0
|
|
iget-object p1, p0, Lrx/internal/a/ai$a;->bFj:Lrx/Scheduler$Worker;
|
|
|
|
invoke-virtual {p1}, Lrx/Scheduler$Worker;->unsubscribe()V
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
iget-object p2, p0, Lrx/internal/a/ai$a;->bFj:Lrx/Scheduler$Worker;
|
|
|
|
invoke-virtual {p2}, Lrx/Scheduler$Worker;->unsubscribe()V
|
|
|
|
throw p1
|
|
|
|
:cond_2
|
|
iget-object p1, p0, Lrx/internal/a/ai$a;->error:Ljava/lang/Throwable;
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
invoke-interface {p4}, Ljava/util/Queue;->clear()V
|
|
|
|
:try_start_1
|
|
invoke-virtual {p3, p1}, Lrx/Subscriber;->onError(Ljava/lang/Throwable;)V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_1
|
|
|
|
iget-object p1, p0, Lrx/internal/a/ai$a;->bFj:Lrx/Scheduler$Worker;
|
|
|
|
invoke-virtual {p1}, Lrx/Scheduler$Worker;->unsubscribe()V
|
|
|
|
return v1
|
|
|
|
:catchall_1
|
|
move-exception p1
|
|
|
|
iget-object p2, p0, Lrx/internal/a/ai$a;->bFj:Lrx/Scheduler$Worker;
|
|
|
|
invoke-virtual {p2}, Lrx/Scheduler$Worker;->unsubscribe()V
|
|
|
|
throw p1
|
|
|
|
:cond_3
|
|
if-eqz p2, :cond_4
|
|
|
|
:try_start_2
|
|
invoke-virtual {p3}, Lrx/Subscriber;->onCompleted()V
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_2
|
|
|
|
iget-object p1, p0, Lrx/internal/a/ai$a;->bFj:Lrx/Scheduler$Worker;
|
|
|
|
invoke-virtual {p1}, Lrx/Scheduler$Worker;->unsubscribe()V
|
|
|
|
return v1
|
|
|
|
:catchall_2
|
|
move-exception p1
|
|
|
|
iget-object p2, p0, Lrx/internal/a/ai$a;->bFj:Lrx/Scheduler$Worker;
|
|
|
|
invoke-virtual {p2}, Lrx/Scheduler$Worker;->unsubscribe()V
|
|
|
|
throw p1
|
|
|
|
:cond_4
|
|
:goto_1
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method protected final Eh()V
|
|
.locals 5
|
|
|
|
iget-object v0, p0, Lrx/internal/a/ai$a;->bFk:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicLong;->getAndIncrement()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-nez v4, :cond_0
|
|
|
|
iget-object v0, p0, Lrx/internal/a/ai$a;->bFj:Lrx/Scheduler$Worker;
|
|
|
|
invoke-virtual {v0, p0}, Lrx/Scheduler$Worker;->b(Lrx/functions/Action0;)Lrx/Subscription;
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public final call()V
|
|
.locals 15
|
|
|
|
iget-wide v0, p0, Lrx/internal/a/ai$a;->bFl:J
|
|
|
|
iget-object v2, p0, Lrx/internal/a/ai$a;->queue:Ljava/util/Queue;
|
|
|
|
iget-object v3, p0, Lrx/internal/a/ai$a;->child:Lrx/Subscriber;
|
|
|
|
const-wide/16 v4, 0x1
|
|
|
|
move-wide v6, v0
|
|
|
|
move-wide v0, v4
|
|
|
|
:cond_0
|
|
iget-object v8, p0, Lrx/internal/a/ai$a;->requested:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
invoke-virtual {v8}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
|
|
|
|
move-result-wide v8
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const-wide/16 v10, 0x0
|
|
|
|
cmp-long v12, v8, v6
|
|
|
|
if-eqz v12, :cond_4
|
|
|
|
iget-boolean v12, p0, Lrx/internal/a/ai$a;->bsH:Z
|
|
|
|
invoke-interface {v2}, Ljava/util/Queue;->poll()Ljava/lang/Object;
|
|
|
|
move-result-object v13
|
|
|
|
if-nez v13, :cond_2
|
|
|
|
const/4 v14, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/4 v14, 0x0
|
|
|
|
:goto_1
|
|
invoke-direct {p0, v12, v14, v3, v2}, Lrx/internal/a/ai$a;->a(ZZLrx/Subscriber;Ljava/util/Queue;)Z
|
|
|
|
move-result v12
|
|
|
|
if-eqz v12, :cond_3
|
|
|
|
return-void
|
|
|
|
:cond_3
|
|
if-nez v14, :cond_4
|
|
|
|
invoke-static {v13}, Lrx/internal/a/g;->bD(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v12
|
|
|
|
invoke-virtual {v3, v12}, Lrx/Subscriber;->onNext(Ljava/lang/Object;)V
|
|
|
|
add-long/2addr v6, v4
|
|
|
|
iget v12, p0, Lrx/internal/a/ai$a;->limit:I
|
|
|
|
int-to-long v12, v12
|
|
|
|
cmp-long v14, v6, v12
|
|
|
|
if-nez v14, :cond_1
|
|
|
|
iget-object v8, p0, Lrx/internal/a/ai$a;->requested:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
invoke-static {v8, v6, v7}, Lrx/internal/a/a;->b(Ljava/util/concurrent/atomic/AtomicLong;J)J
|
|
|
|
move-result-wide v8
|
|
|
|
invoke-virtual {p0, v6, v7}, Lrx/internal/a/ai$a;->request(J)V
|
|
|
|
move-wide v6, v10
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
cmp-long v12, v8, v6
|
|
|
|
if-nez v12, :cond_5
|
|
|
|
iget-boolean v8, p0, Lrx/internal/a/ai$a;->bsH:Z
|
|
|
|
invoke-interface {v2}, Ljava/util/Queue;->isEmpty()Z
|
|
|
|
move-result v9
|
|
|
|
invoke-direct {p0, v8, v9, v3, v2}, Lrx/internal/a/ai$a;->a(ZZLrx/Subscriber;Ljava/util/Queue;)Z
|
|
|
|
move-result v8
|
|
|
|
if-eqz v8, :cond_5
|
|
|
|
return-void
|
|
|
|
:cond_5
|
|
iput-wide v6, p0, Lrx/internal/a/ai$a;->bFl:J
|
|
|
|
iget-object v8, p0, Lrx/internal/a/ai$a;->bFk:Ljava/util/concurrent/atomic/AtomicLong;
|
|
|
|
neg-long v0, v0
|
|
|
|
invoke-virtual {v8, v0, v1}, Ljava/util/concurrent/atomic/AtomicLong;->addAndGet(J)J
|
|
|
|
move-result-wide v0
|
|
|
|
cmp-long v8, v0, v10
|
|
|
|
if-nez v8, :cond_0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final onCompleted()V
|
|
.locals 1
|
|
|
|
invoke-virtual {p0}, Lrx/internal/a/ai$a;->isUnsubscribed()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
iget-boolean v0, p0, Lrx/internal/a/ai$a;->bsH:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
iput-boolean v0, p0, Lrx/internal/a/ai$a;->bsH:Z
|
|
|
|
invoke-virtual {p0}, Lrx/internal/a/ai$a;->Eh()V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public final onError(Ljava/lang/Throwable;)V
|
|
.locals 1
|
|
|
|
invoke-virtual {p0}, Lrx/internal/a/ai$a;->isUnsubscribed()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
iget-boolean v0, p0, Lrx/internal/a/ai$a;->bsH:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iput-object p1, p0, Lrx/internal/a/ai$a;->error:Ljava/lang/Throwable;
|
|
|
|
const/4 p1, 0x1
|
|
|
|
iput-boolean p1, p0, Lrx/internal/a/ai$a;->bsH:Z
|
|
|
|
invoke-virtual {p0}, Lrx/internal/a/ai$a;->Eh()V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
:goto_0
|
|
invoke-static {p1}, Lrx/c/c;->onError(Ljava/lang/Throwable;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final onNext(Ljava/lang/Object;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(TT;)V"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Lrx/internal/a/ai$a;->isUnsubscribed()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
iget-boolean v0, p0, Lrx/internal/a/ai$a;->bsH:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lrx/internal/a/ai$a;->queue:Ljava/util/Queue;
|
|
|
|
invoke-static {p1}, Lrx/internal/a/g;->bz(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/Queue;->offer(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_1
|
|
|
|
new-instance p1, Lrx/a/c;
|
|
|
|
invoke-direct {p1}, Lrx/a/c;-><init>()V
|
|
|
|
invoke-virtual {p0, p1}, Lrx/internal/a/ai$a;->onError(Ljava/lang/Throwable;)V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
invoke-virtual {p0}, Lrx/internal/a/ai$a;->Eh()V
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
:goto_0
|
|
return-void
|
|
.end method
|