345 lines
11 KiB
Smali
345 lines
11 KiB
Smali
.class public final Lcom/discord/utilities/voice/RingManager;
|
|
.super Ljava/lang/Object;
|
|
.source "RingManager.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/utilities/voice/RingManager$StoreState;,
|
|
Lcom/discord/utilities/voice/RingManager$IStoreStateGenerator;,
|
|
Lcom/discord/utilities/voice/RingManager$StoreStateGenerator;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final appComponent:Lcom/discord/app/AppComponent;
|
|
|
|
.field public final appSoundManager:Lcom/discord/utilities/media/AppSoundManager;
|
|
|
|
.field public final storeStateGenerator:Lcom/discord/utilities/voice/RingManager$IStoreStateGenerator;
|
|
|
|
.field public storeStateSubscription:Lrx/Subscription;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lcom/discord/app/AppComponent;Lcom/discord/utilities/media/AppSoundManager;Lcom/discord/utilities/voice/RingManager$IStoreStateGenerator;)V
|
|
.locals 1
|
|
|
|
const-string v0, "appComponent"
|
|
|
|
invoke-static {p1, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "appSoundManager"
|
|
|
|
invoke-static {p2, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "storeStateGenerator"
|
|
|
|
invoke-static {p3, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/utilities/voice/RingManager;->appComponent:Lcom/discord/app/AppComponent;
|
|
|
|
iput-object p2, p0, Lcom/discord/utilities/voice/RingManager;->appSoundManager:Lcom/discord/utilities/media/AppSoundManager;
|
|
|
|
iput-object p3, p0, Lcom/discord/utilities/voice/RingManager;->storeStateGenerator:Lcom/discord/utilities/voice/RingManager$IStoreStateGenerator;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Lcom/discord/app/AppComponent;Lcom/discord/utilities/media/AppSoundManager;Lcom/discord/utilities/voice/RingManager$IStoreStateGenerator;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
.locals 0
|
|
|
|
and-int/lit8 p5, p4, 0x2
|
|
|
|
if-eqz p5, :cond_0
|
|
|
|
sget-object p2, Lcom/discord/utilities/media/AppSoundManager$Provider;->INSTANCE:Lcom/discord/utilities/media/AppSoundManager$Provider;
|
|
|
|
invoke-virtual {p2}, Lcom/discord/utilities/media/AppSoundManager$Provider;->get()Lcom/discord/utilities/media/AppSoundManager;
|
|
|
|
move-result-object p2
|
|
|
|
:cond_0
|
|
and-int/lit8 p4, p4, 0x4
|
|
|
|
if-eqz p4, :cond_1
|
|
|
|
new-instance p3, Lcom/discord/utilities/voice/RingManager$StoreStateGenerator;
|
|
|
|
const/4 p4, 0x3
|
|
|
|
const/4 p5, 0x0
|
|
|
|
invoke-direct {p3, p5, p5, p4, p5}, Lcom/discord/utilities/voice/RingManager$StoreStateGenerator;-><init>(Lcom/discord/stores/StoreVoiceParticipants;Lcom/discord/stores/StoreRtcConnection;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
:cond_1
|
|
invoke-direct {p0, p1, p2, p3}, Lcom/discord/utilities/voice/RingManager;-><init>(Lcom/discord/app/AppComponent;Lcom/discord/utilities/media/AppSoundManager;Lcom/discord/utilities/voice/RingManager$IStoreStateGenerator;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$getAppSoundManager$p(Lcom/discord/utilities/voice/RingManager;)Lcom/discord/utilities/media/AppSoundManager;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/utilities/voice/RingManager;->appSoundManager:Lcom/discord/utilities/media/AppSoundManager;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getStoreStateSubscription$p(Lcom/discord/utilities/voice/RingManager;)Lrx/Subscription;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/utilities/voice/RingManager;->storeStateSubscription:Lrx/Subscription;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$handleStoreState(Lcom/discord/utilities/voice/RingManager;Lcom/discord/utilities/voice/RingManager$StoreState;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/voice/RingManager;->handleStoreState(Lcom/discord/utilities/voice/RingManager$StoreState;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$setStoreStateSubscription$p(Lcom/discord/utilities/voice/RingManager;Lrx/Subscription;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/discord/utilities/voice/RingManager;->storeStateSubscription:Lrx/Subscription;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final handleStoreState(Lcom/discord/utilities/voice/RingManager$StoreState;)V
|
|
.locals 5
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
.end annotation
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/voice/RingManager$StoreState;->getVoiceParticipants()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/voice/RingManager$StoreState;->getRtcConnectionState()Lcom/discord/rtcconnection/RtcConnection$State;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object v1, Lcom/discord/rtcconnection/RtcConnection$State$f;->a:Lcom/discord/rtcconnection/RtcConnection$State$f;
|
|
|
|
invoke-static {p1, v1}, Lb0/n/c/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
invoke-interface {v0}, Ljava/util/Map;->values()Ljava/util/Collection;
|
|
|
|
move-result-object v1
|
|
|
|
new-instance v2, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {v1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v1
|
|
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
move-object v4, v3
|
|
|
|
check-cast v4, Lcom/discord/stores/StoreVoiceParticipants$VoiceUser;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/stores/StoreVoiceParticipants$VoiceUser;->isConnected()Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
invoke-interface {v2, v3}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-interface {v2}, Ljava/util/List;->size()I
|
|
|
|
move-result v1
|
|
|
|
invoke-interface {v0}, Ljava/util/Map;->values()Ljava/util/Collection;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v2, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_2
|
|
:goto_1
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
move-object v4, v3
|
|
|
|
check-cast v4, Lcom/discord/stores/StoreVoiceParticipants$VoiceUser;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/stores/StoreVoiceParticipants$VoiceUser;->isRinging()Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_2
|
|
|
|
invoke-interface {v2, v3}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
invoke-interface {v2}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v2, 0x2
|
|
|
|
if-ge v1, v2, :cond_4
|
|
|
|
if-lez v0, :cond_4
|
|
|
|
iget-object v3, p0, Lcom/discord/utilities/voice/RingManager;->appSoundManager:Lcom/discord/utilities/media/AppSoundManager;
|
|
|
|
sget-object v4, Lcom/discord/utilities/media/AppSound;->Companion:Lcom/discord/utilities/media/AppSound$Companion;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/utilities/media/AppSound$Companion;->getSOUND_CALL_CALLING()Lcom/discord/utilities/media/AppSound;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v3, v4}, Lcom/discord/utilities/media/AppSoundManager;->isPlaying(Lcom/discord/utilities/media/AppSound;)Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_4
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
iget-object p1, p0, Lcom/discord/utilities/voice/RingManager;->appSoundManager:Lcom/discord/utilities/media/AppSoundManager;
|
|
|
|
sget-object v0, Lcom/discord/utilities/media/AppSound;->Companion:Lcom/discord/utilities/media/AppSound$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/media/AppSound$Companion;->getSOUND_CALL_CALLING()Lcom/discord/utilities/media/AppSound;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1, v0}, Lcom/discord/utilities/media/AppSoundManager;->play(Lcom/discord/utilities/media/AppSound;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
if-eqz p1, :cond_5
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
if-lt v1, v2, :cond_6
|
|
|
|
:cond_5
|
|
iget-object p1, p0, Lcom/discord/utilities/voice/RingManager;->appSoundManager:Lcom/discord/utilities/media/AppSoundManager;
|
|
|
|
sget-object v0, Lcom/discord/utilities/media/AppSound;->Companion:Lcom/discord/utilities/media/AppSound$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/media/AppSound$Companion;->getSOUND_CALL_CALLING()Lcom/discord/utilities/media/AppSound;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1, v0}, Lcom/discord/utilities/media/AppSoundManager;->stop(Lcom/discord/utilities/media/AppSound;)V
|
|
|
|
:cond_6
|
|
:goto_2
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final subscribeToStoreState(J)V
|
|
.locals 11
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/voice/RingManager;->storeStateSubscription:Lrx/Subscription;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-interface {v0}, Lrx/Subscription;->unsubscribe()V
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/discord/utilities/voice/RingManager;->storeStateGenerator:Lcom/discord/utilities/voice/RingManager$IStoreStateGenerator;
|
|
|
|
invoke-interface {v0, p1, p2}, Lcom/discord/utilities/voice/RingManager$IStoreStateGenerator;->observeStoreState(J)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "storeStateGenerator\n \u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {p1, p2}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationLatest(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object p2, p0, Lcom/discord/utilities/voice/RingManager;->appComponent:Lcom/discord/app/AppComponent;
|
|
|
|
const/4 v0, 0x2
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-static {p1, p2, v1, v0, v1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v2
|
|
|
|
const-class v3, Lcom/discord/utilities/voice/RingManager;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
new-instance v5, Lcom/discord/utilities/voice/RingManager$subscribeToStoreState$1;
|
|
|
|
invoke-direct {v5, p0}, Lcom/discord/utilities/voice/RingManager$subscribeToStoreState$1;-><init>(Lcom/discord/utilities/voice/RingManager;)V
|
|
|
|
const/4 v6, 0x0
|
|
|
|
new-instance v7, Lcom/discord/utilities/voice/RingManager$subscribeToStoreState$2;
|
|
|
|
invoke-direct {v7, p0}, Lcom/discord/utilities/voice/RingManager$subscribeToStoreState$2;-><init>(Lcom/discord/utilities/voice/RingManager;)V
|
|
|
|
new-instance v8, Lcom/discord/utilities/voice/RingManager$subscribeToStoreState$3;
|
|
|
|
invoke-direct {v8, p0}, Lcom/discord/utilities/voice/RingManager$subscribeToStoreState$3;-><init>(Lcom/discord/utilities/voice/RingManager;)V
|
|
|
|
const/16 v9, 0xa
|
|
|
|
const/4 v10, 0x0
|
|
|
|
invoke-static/range {v2 .. v10}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|