325 lines
8.6 KiB
Smali
325 lines
8.6 KiB
Smali
.class final Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;
|
|
.super Ljava/util/concurrent/atomic/AtomicInteger;
|
|
.source "FlowableWindow.java"
|
|
|
|
# interfaces
|
|
.implements Lkh/o;
|
|
.implements Lok/e;
|
|
.implements Ljava/lang/Runnable;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lio/reactivex/internal/operators/flowable/FlowableWindow;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "WindowExactSubscriber"
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">",
|
|
"Ljava/util/concurrent/atomic/AtomicInteger;",
|
|
"Lkh/o<",
|
|
"TT;>;",
|
|
"Lok/e;",
|
|
"Ljava/lang/Runnable;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final serialVersionUID:J = -0x20d478356927aeadL
|
|
|
|
|
|
# instance fields
|
|
.field public final bufferSize:I
|
|
|
|
.field public final downstream:Lok/d;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lok/d<",
|
|
"-",
|
|
"Lkh/j<",
|
|
"TT;>;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public index:J
|
|
|
|
.field public final once:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
.field public final size:J
|
|
|
|
.field public upstream:Lok/e;
|
|
|
|
.field public window:Lio/reactivex/processors/UnicastProcessor;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lio/reactivex/processors/UnicastProcessor<",
|
|
"TT;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lok/d;JI)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lok/d<",
|
|
"-",
|
|
"Lkh/j<",
|
|
"TT;>;>;JI)V"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 1
|
|
invoke-direct {p0, v0}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>(I)V
|
|
|
|
.line 2
|
|
iput-object p1, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->downstream:Lok/d;
|
|
|
|
.line 3
|
|
iput-wide p2, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->size:J
|
|
|
|
.line 4
|
|
new-instance p1, Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
invoke-direct {p1}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>()V
|
|
|
|
iput-object p1, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->once:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
.line 5
|
|
iput p4, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->bufferSize:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public cancel()V
|
|
.locals 3
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->once:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-virtual {v0, v1, v2}, Ljava/util/concurrent/atomic/AtomicBoolean;->compareAndSet(ZZ)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
invoke-virtual {p0}, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->run()V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public onComplete()V
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->window:Lio/reactivex/processors/UnicastProcessor;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 2
|
|
iput-object v1, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->window:Lio/reactivex/processors/UnicastProcessor;
|
|
|
|
.line 3
|
|
invoke-interface {v0}, Lok/d;->onComplete()V
|
|
|
|
.line 4
|
|
:cond_0
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->downstream:Lok/d;
|
|
|
|
invoke-interface {v0}, Lok/d;->onComplete()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onError(Ljava/lang/Throwable;)V
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->window:Lio/reactivex/processors/UnicastProcessor;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 2
|
|
iput-object v1, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->window:Lio/reactivex/processors/UnicastProcessor;
|
|
|
|
.line 3
|
|
invoke-interface {v0, p1}, Lok/d;->onError(Ljava/lang/Throwable;)V
|
|
|
|
.line 4
|
|
:cond_0
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->downstream:Lok/d;
|
|
|
|
invoke-interface {v0, p1}, Lok/d;->onError(Ljava/lang/Throwable;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onNext(Ljava/lang/Object;)V
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(TT;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-wide v0, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->index:J
|
|
|
|
.line 2
|
|
iget-object v2, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->window:Lio/reactivex/processors/UnicastProcessor;
|
|
|
|
const-wide/16 v3, 0x0
|
|
|
|
cmp-long v5, v0, v3
|
|
|
|
if-nez v5, :cond_0
|
|
|
|
.line 3
|
|
invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicInteger;->getAndIncrement()I
|
|
|
|
.line 4
|
|
iget v2, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->bufferSize:I
|
|
|
|
invoke-static {v2, p0}, Lio/reactivex/processors/UnicastProcessor;->Q8(ILjava/lang/Runnable;)Lio/reactivex/processors/UnicastProcessor;
|
|
|
|
move-result-object v2
|
|
|
|
.line 5
|
|
iput-object v2, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->window:Lio/reactivex/processors/UnicastProcessor;
|
|
|
|
.line 6
|
|
iget-object v5, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->downstream:Lok/d;
|
|
|
|
invoke-interface {v5, v2}, Lok/d;->onNext(Ljava/lang/Object;)V
|
|
|
|
:cond_0
|
|
const-wide/16 v5, 0x1
|
|
|
|
add-long/2addr v0, v5
|
|
|
|
.line 7
|
|
invoke-virtual {v2, p1}, Lio/reactivex/processors/UnicastProcessor;->onNext(Ljava/lang/Object;)V
|
|
|
|
.line 8
|
|
iget-wide v5, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->size:J
|
|
|
|
cmp-long p1, v0, v5
|
|
|
|
if-nez p1, :cond_1
|
|
|
|
.line 9
|
|
iput-wide v3, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->index:J
|
|
|
|
const/4 p1, 0x0
|
|
|
|
.line 10
|
|
iput-object p1, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->window:Lio/reactivex/processors/UnicastProcessor;
|
|
|
|
.line 11
|
|
invoke-virtual {v2}, Lio/reactivex/processors/UnicastProcessor;->onComplete()V
|
|
|
|
goto :goto_0
|
|
|
|
.line 12
|
|
:cond_1
|
|
iput-wide v0, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->index:J
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public onSubscribe(Lok/e;)V
|
|
.locals 1
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->upstream:Lok/e;
|
|
|
|
invoke-static {v0, p1}, Lio/reactivex/internal/subscriptions/SubscriptionHelper;->validate(Lok/e;Lok/e;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
iput-object p1, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->upstream:Lok/e;
|
|
|
|
.line 3
|
|
iget-object p1, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->downstream:Lok/d;
|
|
|
|
invoke-interface {p1, p0}, Lok/d;->onSubscribe(Lok/e;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public request(J)V
|
|
.locals 2
|
|
|
|
.line 1
|
|
invoke-static {p1, p2}, Lio/reactivex/internal/subscriptions/SubscriptionHelper;->validate(J)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
iget-wide v0, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->size:J
|
|
|
|
invoke-static {v0, v1, p1, p2}, Lio/reactivex/internal/util/b;->d(JJ)J
|
|
|
|
move-result-wide p1
|
|
|
|
.line 3
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->upstream:Lok/e;
|
|
|
|
invoke-interface {v0, p1, p2}, Lok/e;->request(J)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public run()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicInteger;->decrementAndGet()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 2
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableWindow$WindowExactSubscriber;->upstream:Lok/e;
|
|
|
|
invoke-interface {v0}, Lok/e;->cancel()V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|