261 lines
5.4 KiB
Smali
261 lines
5.4 KiB
Smali
.class public final Lrx/subjects/PublishSubject$a;
|
|
.super Ljava/util/concurrent/atomic/AtomicLong;
|
|
.source "PublishSubject.java"
|
|
|
|
# interfaces
|
|
.implements Lrx/Producer;
|
|
.implements Lrx/Subscription;
|
|
.implements Le0/g;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lrx/subjects/PublishSubject;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "a"
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">",
|
|
"Ljava/util/concurrent/atomic/AtomicLong;",
|
|
"Lrx/Producer;",
|
|
"Lrx/Subscription;",
|
|
"Le0/g<",
|
|
"TT;>;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final serialVersionUID:J = 0x59896c1df8e78b00L
|
|
|
|
|
|
# instance fields
|
|
.field public final actual:Lrx/Subscriber;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/Subscriber<",
|
|
"-TT;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final parent:Lrx/subjects/PublishSubject$b;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/subjects/PublishSubject$b<",
|
|
"TT;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public produced:J
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lrx/subjects/PublishSubject$b;Lrx/Subscriber;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lrx/subjects/PublishSubject$b<",
|
|
"TT;>;",
|
|
"Lrx/Subscriber<",
|
|
"-TT;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Ljava/util/concurrent/atomic/AtomicLong;-><init>()V
|
|
|
|
iput-object p1, p0, Lrx/subjects/PublishSubject$a;->parent:Lrx/subjects/PublishSubject$b;
|
|
|
|
iput-object p2, p0, Lrx/subjects/PublishSubject$a;->actual:Lrx/Subscriber;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a(J)V
|
|
.locals 5
|
|
|
|
invoke-static {p1, p2}, Lx/a/a2/w;->a(J)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/high16 v2, -0x8000000000000000L
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-nez v4, :cond_1
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
invoke-static {v0, v1, p1, p2}, Lx/a/a2/w;->a(JJ)J
|
|
|
|
move-result-wide v2
|
|
|
|
invoke-virtual {p0, v0, v1, v2, v3}, Ljava/util/concurrent/atomic/AtomicLong;->compareAndSet(JJ)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
:cond_2
|
|
return-void
|
|
.end method
|
|
|
|
.method public isUnsubscribed()Z
|
|
.locals 5
|
|
|
|
invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/high16 v2, -0x8000000000000000L
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-nez v4, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public onCompleted()V
|
|
.locals 5
|
|
|
|
invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/high16 v2, -0x8000000000000000L
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
iget-object v0, p0, Lrx/subjects/PublishSubject$a;->actual:Lrx/Subscriber;
|
|
|
|
invoke-interface {v0}, Le0/g;->onCompleted()V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public onError(Ljava/lang/Throwable;)V
|
|
.locals 5
|
|
|
|
invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/high16 v2, -0x8000000000000000L
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
iget-object v0, p0, Lrx/subjects/PublishSubject$a;->actual:Lrx/Subscriber;
|
|
|
|
invoke-interface {v0, p1}, Le0/g;->onError(Ljava/lang/Throwable;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public onNext(Ljava/lang/Object;)V
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(TT;)V"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicLong;->get()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/high16 v2, -0x8000000000000000L
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-eqz v4, :cond_1
|
|
|
|
iget-wide v2, p0, Lrx/subjects/PublishSubject$a;->produced:J
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
const-wide/16 v0, 0x1
|
|
|
|
add-long/2addr v2, v0
|
|
|
|
iput-wide v2, p0, Lrx/subjects/PublishSubject$a;->produced:J
|
|
|
|
iget-object v0, p0, Lrx/subjects/PublishSubject$a;->actual:Lrx/Subscriber;
|
|
|
|
invoke-interface {v0, p1}, Le0/g;->onNext(Ljava/lang/Object;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Lrx/subjects/PublishSubject$a;->unsubscribe()V
|
|
|
|
iget-object p1, p0, Lrx/subjects/PublishSubject$a;->actual:Lrx/Subscriber;
|
|
|
|
new-instance v0, Le0/k/b;
|
|
|
|
const-string v1, "PublishSubject: could not emit value due to lack of requests"
|
|
|
|
invoke-direct {v0, v1}, Le0/k/b;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-interface {p1, v0}, Le0/g;->onError(Ljava/lang/Throwable;)V
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public unsubscribe()V
|
|
.locals 5
|
|
|
|
const-wide/high16 v0, -0x8000000000000000L
|
|
|
|
invoke-virtual {p0, v0, v1}, Ljava/util/concurrent/atomic/AtomicLong;->getAndSet(J)J
|
|
|
|
move-result-wide v2
|
|
|
|
cmp-long v4, v2, v0
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
iget-object v0, p0, Lrx/subjects/PublishSubject$a;->parent:Lrx/subjects/PublishSubject$b;
|
|
|
|
invoke-virtual {v0, p0}, Lrx/subjects/PublishSubject$b;->b(Lrx/subjects/PublishSubject$a;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|