apkfuckery/com.discord/smali/com/discord/stores/updates/ObservationDeck.smali

529 lines
15 KiB
Smali

.class public final Lcom/discord/stores/updates/ObservationDeck;
.super Ljava/lang/Object;
.source "ObservationDeck.kt"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/discord/stores/updates/ObservationDeck$Observer;,
Lcom/discord/stores/updates/ObservationDeck$UpdateSource;,
Lcom/discord/stores/updates/ObservationDeck$Companion;
}
.end annotation
# static fields
.field public static final Companion:Lcom/discord/stores/updates/ObservationDeck$Companion;
.field public static final ON_UPDATE_EMPTY:Lkotlin/jvm/functions/Function0;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lkotlin/jvm/functions/Function0<",
"Lkotlin/Unit;",
">;"
}
.end annotation
.end field
# instance fields
.field public observers:Ljava/util/Set;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Set<",
"Lcom/discord/stores/updates/ObservationDeck$Observer;",
">;"
}
.end annotation
.end field
# direct methods
.method public static constructor <clinit>()V
.locals 2
new-instance v0, Lcom/discord/stores/updates/ObservationDeck$Companion;
const/4 v1, 0x0
invoke-direct {v0, v1}, Lcom/discord/stores/updates/ObservationDeck$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
sput-object v0, Lcom/discord/stores/updates/ObservationDeck;->Companion:Lcom/discord/stores/updates/ObservationDeck$Companion;
sget-object v0, Lcom/discord/stores/updates/ObservationDeck$Companion$ON_UPDATE_EMPTY$1;->INSTANCE:Lcom/discord/stores/updates/ObservationDeck$Companion$ON_UPDATE_EMPTY$1;
sput-object v0, Lcom/discord/stores/updates/ObservationDeck;->ON_UPDATE_EMPTY:Lkotlin/jvm/functions/Function0;
return-void
.end method
.method public constructor <init>()V
.locals 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
new-instance v0, Ljava/util/LinkedHashSet;
invoke-direct {v0}, Ljava/util/LinkedHashSet;-><init>()V
iput-object v0, p0, Lcom/discord/stores/updates/ObservationDeck;->observers:Ljava/util/Set;
return-void
.end method
.method public static final synthetic access$getON_UPDATE_EMPTY$cp()Lkotlin/jvm/functions/Function0;
.locals 1
sget-object v0, Lcom/discord/stores/updates/ObservationDeck;->ON_UPDATE_EMPTY:Lkotlin/jvm/functions/Function0;
return-object v0
.end method
.method public static synthetic connect$default(Lcom/discord/stores/updates/ObservationDeck;Lcom/discord/stores/updates/ObservationDeck$Observer;ZILjava/lang/Object;)Lcom/discord/stores/updates/ObservationDeck$Observer;
.locals 0
and-int/lit8 p3, p3, 0x2
if-eqz p3, :cond_0
const/4 p2, 0x1
:cond_0
invoke-virtual {p0, p1, p2}, Lcom/discord/stores/updates/ObservationDeck;->connect(Lcom/discord/stores/updates/ObservationDeck$Observer;Z)Lcom/discord/stores/updates/ObservationDeck$Observer;
move-result-object p0
return-object p0
.end method
.method public static synthetic connect$default(Lcom/discord/stores/updates/ObservationDeck;[Lcom/discord/stores/updates/ObservationDeck$UpdateSource;ZLkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lcom/discord/stores/updates/ObservationDeck$Observer;
.locals 0
and-int/lit8 p4, p4, 0x2
if-eqz p4, :cond_0
const/4 p2, 0x1
:cond_0
invoke-virtual {p0, p1, p2, p3}, Lcom/discord/stores/updates/ObservationDeck;->connect([Lcom/discord/stores/updates/ObservationDeck$UpdateSource;ZLkotlin/jvm/functions/Function0;)Lcom/discord/stores/updates/ObservationDeck$Observer;
move-result-object p0
return-object p0
.end method
.method public static synthetic connectRx$default(Lcom/discord/stores/updates/ObservationDeck;[Lcom/discord/stores/updates/ObservationDeck$UpdateSource;ZLrx/Emitter$BackpressureMode;ILjava/lang/Object;)Lrx/Observable;
.locals 0
and-int/lit8 p5, p4, 0x2
if-eqz p5, :cond_0
const/4 p2, 0x1
:cond_0
and-int/lit8 p4, p4, 0x4
if-eqz p4, :cond_1
sget-object p3, Lrx/Emitter$BackpressureMode;->h:Lrx/Emitter$BackpressureMode;
:cond_1
invoke-virtual {p0, p1, p2, p3}, Lcom/discord/stores/updates/ObservationDeck;->connectRx([Lcom/discord/stores/updates/ObservationDeck$UpdateSource;ZLrx/Emitter$BackpressureMode;)Lrx/Observable;
move-result-object p0
return-object p0
.end method
.method public static synthetic connectRx$default(Lcom/discord/stores/updates/ObservationDeck;[Lcom/discord/stores/updates/ObservationDeck$UpdateSource;ZLrx/Emitter$BackpressureMode;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lrx/Observable;
.locals 0
and-int/lit8 p6, p5, 0x2
if-eqz p6, :cond_0
const/4 p2, 0x1
:cond_0
and-int/lit8 p5, p5, 0x4
if-eqz p5, :cond_1
sget-object p3, Lrx/Emitter$BackpressureMode;->h:Lrx/Emitter$BackpressureMode;
:cond_1
invoke-virtual {p0, p1, p2, p3, p4}, Lcom/discord/stores/updates/ObservationDeck;->connectRx([Lcom/discord/stores/updates/ObservationDeck$UpdateSource;ZLrx/Emitter$BackpressureMode;Lkotlin/jvm/functions/Function0;)Lrx/Observable;
move-result-object p0
return-object p0
.end method
# virtual methods
.method public final declared-synchronized connect(Lcom/discord/stores/updates/ObservationDeck$Observer;Z)Lcom/discord/stores/updates/ObservationDeck$Observer;
.locals 1
monitor-enter p0
:try_start_0
const-string v0, "observer"
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
iget-object v0, p0, Lcom/discord/stores/updates/ObservationDeck;->observers:Ljava/util/Set;
invoke-interface {v0, p1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
if-eqz p2, :cond_0
invoke-virtual {p1}, Lcom/discord/stores/updates/ObservationDeck$Observer;->getOnUpdate()Lkotlin/jvm/functions/Function0;
move-result-object p2
invoke-interface {p2}, Lkotlin/jvm/functions/Function0;->invoke()Ljava/lang/Object;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:cond_0
monitor-exit p0
return-object p1
:catchall_0
move-exception p1
monitor-exit p0
throw p1
.end method
.method public final declared-synchronized connect([Lcom/discord/stores/updates/ObservationDeck$UpdateSource;ZLkotlin/jvm/functions/Function0;)Lcom/discord/stores/updates/ObservationDeck$Observer;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"([",
"Lcom/discord/stores/updates/ObservationDeck$UpdateSource;",
"Z",
"Lkotlin/jvm/functions/Function0<",
"Lkotlin/Unit;",
">;)",
"Lcom/discord/stores/updates/ObservationDeck$Observer;"
}
.end annotation
monitor-enter p0
:try_start_0
const-string/jumbo v0, "updateSources"
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "onUpdate"
invoke-static {p3, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
new-instance v0, Lcom/discord/stores/updates/ObservationDeck$connect$observer$1;
invoke-direct {v0, p1, p3}, Lcom/discord/stores/updates/ObservationDeck$connect$observer$1;-><init>([Lcom/discord/stores/updates/ObservationDeck$UpdateSource;Lkotlin/jvm/functions/Function0;)V
invoke-virtual {p0, v0, p2}, Lcom/discord/stores/updates/ObservationDeck;->connect(Lcom/discord/stores/updates/ObservationDeck$Observer;Z)Lcom/discord/stores/updates/ObservationDeck$Observer;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return-object v0
:catchall_0
move-exception p1
monitor-exit p0
throw p1
.end method
.method public final declared-synchronized connectRx([Lcom/discord/stores/updates/ObservationDeck$UpdateSource;ZLrx/Emitter$BackpressureMode;)Lrx/Observable;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"([",
"Lcom/discord/stores/updates/ObservationDeck$UpdateSource;",
"Z",
"Lrx/Emitter$BackpressureMode;",
")",
"Lrx/Observable<",
"Lkotlin/Unit;",
">;"
}
.end annotation
monitor-enter p0
:try_start_0
const-string/jumbo v0, "updateSources"
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "backpressureMode"
invoke-static {p3, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
new-instance v0, Lkotlin/jvm/internal/Ref$ObjectRef;
invoke-direct {v0}, Lkotlin/jvm/internal/Ref$ObjectRef;-><init>()V
const/4 v1, 0x0
iput-object v1, v0, Lkotlin/jvm/internal/Ref$ObjectRef;->element:Ljava/lang/Object;
new-instance v1, Lcom/discord/stores/updates/ObservationDeck$connectRx$1;
invoke-direct {v1, p0, v0, p2, p1}, Lcom/discord/stores/updates/ObservationDeck$connectRx$1;-><init>(Lcom/discord/stores/updates/ObservationDeck;Lkotlin/jvm/internal/Ref$ObjectRef;Z[Lcom/discord/stores/updates/ObservationDeck$UpdateSource;)V
invoke-static {v1, p3}, Lrx/Observable;->n(Lrx/functions/Action1;Lrx/Emitter$BackpressureMode;)Lrx/Observable;
move-result-object p1
new-instance p2, Lcom/discord/stores/updates/ObservationDeck$connectRx$2;
invoke-direct {p2, p0, v0}, Lcom/discord/stores/updates/ObservationDeck$connectRx$2;-><init>(Lcom/discord/stores/updates/ObservationDeck;Lkotlin/jvm/internal/Ref$ObjectRef;)V
invoke-virtual {p1, p2}, Lrx/Observable;->u(Lrx/functions/Action0;)Lrx/Observable;
move-result-object p1
const-string p2, "Observable.create<Unit>(\u2026rver?.let(::disconnect) }"
invoke-static {p1, p2}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return-object p1
:catchall_0
move-exception p1
monitor-exit p0
throw p1
.end method
.method public final declared-synchronized connectRx([Lcom/discord/stores/updates/ObservationDeck$UpdateSource;ZLrx/Emitter$BackpressureMode;Lkotlin/jvm/functions/Function0;)Lrx/Observable;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">([",
"Lcom/discord/stores/updates/ObservationDeck$UpdateSource;",
"Z",
"Lrx/Emitter$BackpressureMode;",
"Lkotlin/jvm/functions/Function0<",
"+TT;>;)",
"Lrx/Observable<",
"TT;>;"
}
.end annotation
monitor-enter p0
:try_start_0
const-string/jumbo v0, "updateSources"
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "backpressureMode"
invoke-static {p3, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "generator"
invoke-static {p4, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
array-length v0, p1
invoke-static {p1, v0}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
move-result-object p1
check-cast p1, [Lcom/discord/stores/updates/ObservationDeck$UpdateSource;
invoke-virtual {p0, p1, p2, p3}, Lcom/discord/stores/updates/ObservationDeck;->connectRx([Lcom/discord/stores/updates/ObservationDeck$UpdateSource;ZLrx/Emitter$BackpressureMode;)Lrx/Observable;
move-result-object p1
new-instance p2, Lcom/discord/stores/updates/ObservationDeck$connectRx$3;
invoke-direct {p2, p4}, Lcom/discord/stores/updates/ObservationDeck$connectRx$3;-><init>(Lkotlin/jvm/functions/Function0;)V
invoke-virtual {p1, p2}, Lrx/Observable;->E(Ll0/k/b;)Lrx/Observable;
move-result-object p1
const-string p2, "connectRx(\n *upda\u2026 ).map { generator() }"
invoke-static {p1, p2}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return-object p1
:catchall_0
move-exception p1
monitor-exit p0
throw p1
.end method
.method public final declared-synchronized disconnect(Lcom/discord/stores/updates/ObservationDeck$Observer;)V
.locals 1
monitor-enter p0
:try_start_0
const-string v0, "observer"
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {p1}, Lcom/discord/stores/updates/ObservationDeck$Observer;->markStale()V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return-void
:catchall_0
move-exception p1
monitor-exit p0
throw p1
.end method
.method public final declared-synchronized notify(Ljava/util/Set;)V
.locals 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/Set<",
"+",
"Lcom/discord/stores/updates/ObservationDeck$UpdateSource;",
">;)V"
}
.end annotation
monitor-enter p0
:try_start_0
const-string/jumbo v0, "updates"
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
iget-object v0, p0, Lcom/discord/stores/updates/ObservationDeck;->observers:Ljava/util/Set;
invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object v0
:cond_0
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_5
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/discord/stores/updates/ObservationDeck$Observer;
invoke-virtual {v1}, Lcom/discord/stores/updates/ObservationDeck$Observer;->isStale()Z
move-result v2
if-eqz v2, :cond_1
invoke-interface {v0}, Ljava/util/Iterator;->remove()V
goto :goto_0
:cond_1
invoke-interface {p1}, Ljava/util/Collection;->isEmpty()Z
move-result v2
const/4 v3, 0x0
if-eqz v2, :cond_2
goto :goto_1
:cond_2
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object v2
:cond_3
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v4
if-eqz v4, :cond_4
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v4
check-cast v4, Lcom/discord/stores/updates/ObservationDeck$UpdateSource;
invoke-virtual {v1}, Lcom/discord/stores/updates/ObservationDeck$Observer;->getObservingUpdates()Ljava/util/Set;
move-result-object v5
invoke-interface {v5, v4}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_3
const/4 v3, 0x1
:cond_4
:goto_1
if-eqz v3, :cond_0
invoke-virtual {v1}, Lcom/discord/stores/updates/ObservationDeck$Observer;->getOnUpdate()Lkotlin/jvm/functions/Function0;
move-result-object v1
invoke-interface {v1}, Lkotlin/jvm/functions/Function0;->invoke()Ljava/lang/Object;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
goto :goto_0
:cond_5
monitor-exit p0
return-void
:catchall_0
move-exception p1
monitor-exit p0
throw p1
.end method