279 lines
7 KiB
Smali
279 lines
7 KiB
Smali
.class public final Lcom/discord/stores/StoreAudioDevices$VideoUseDetector;
|
|
.super Ljava/lang/Object;
|
|
.source "StoreAudioDevices.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/stores/StoreAudioDevices;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "VideoUseDetector"
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final channelsStore:Lcom/discord/stores/StoreChannels;
|
|
|
|
.field public final usersStore:Lcom/discord/stores/StoreUser;
|
|
|
|
.field public final voiceStatesStore:Lcom/discord/stores/StoreVoiceStates;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lcom/discord/stores/StoreChannels;Lcom/discord/stores/StoreVoiceStates;Lcom/discord/stores/StoreUser;)V
|
|
.locals 1
|
|
|
|
const-string v0, "channelsStore"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string/jumbo v0, "voiceStatesStore"
|
|
|
|
invoke-static {p2, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string/jumbo v0, "usersStore"
|
|
|
|
invoke-static {p3, v0}, Ly/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/stores/StoreAudioDevices$VideoUseDetector;->channelsStore:Lcom/discord/stores/StoreChannels;
|
|
|
|
iput-object p2, p0, Lcom/discord/stores/StoreAudioDevices$VideoUseDetector;->voiceStatesStore:Lcom/discord/stores/StoreVoiceStates;
|
|
|
|
iput-object p3, p0, Lcom/discord/stores/StoreAudioDevices$VideoUseDetector;->usersStore:Lcom/discord/stores/StoreUser;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getVoiceStatesForChannel(J)Ljava/util/Map;
|
|
.locals 6
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J)",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Lcom/discord/models/domain/ModelVoice$State;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreAudioDevices$VideoUseDetector;->channelsStore:Lcom/discord/stores/StoreChannels;
|
|
|
|
invoke-virtual {v0, p1, p2}, Lcom/discord/stores/StoreChannels;->getChannel$app_productionDiscordExternalRelease(J)Lcom/discord/models/domain/ModelChannel;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelChannel;->getGuildId()Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
iget-object v1, p0, Lcom/discord/stores/StoreAudioDevices$VideoUseDetector;->voiceStatesStore:Lcom/discord/stores/StoreVoiceStates;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreVoiceStates;->getMediaStatesBlocking()Ljava/util/Map;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v1, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/Map;
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
new-instance v1, Ljava/util/LinkedHashMap;
|
|
|
|
invoke-direct {v1}, Ljava/util/LinkedHashMap;-><init>()V
|
|
|
|
invoke-interface {v0}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_1
|
|
:goto_1
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_5
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/util/Map$Entry;
|
|
|
|
invoke-interface {v2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Lcom/discord/models/domain/ModelVoice$State;
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelVoice$State;->getChannelId()Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
if-nez v3, :cond_2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
invoke-virtual {v3}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v3
|
|
|
|
cmp-long v5, v3, p1
|
|
|
|
if-nez v5, :cond_3
|
|
|
|
const/4 v3, 0x1
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
:goto_2
|
|
const/4 v3, 0x0
|
|
|
|
:goto_3
|
|
if-eqz v3, :cond_1
|
|
|
|
invoke-interface {v2}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v3, v2}, Ljava/util/LinkedHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
sget-object v1, Ly/i/m;->d:Ly/i/m;
|
|
|
|
:cond_5
|
|
return-object v1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final isAnyoneUsingVideoInChannel(J)Z
|
|
.locals 1
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/stores/StoreAudioDevices$VideoUseDetector;->getVoiceStatesForChannel(J)Ljava/util/Map;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {p1}, Ljava/util/Map;->values()Ljava/util/Collection;
|
|
|
|
move-result-object p1
|
|
|
|
instance-of p2, p1, Ljava/util/Collection;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-interface {p1}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_1
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Lcom/discord/models/domain/ModelVoice$State;
|
|
|
|
invoke-virtual {p2}, Lcom/discord/models/domain/ModelVoice$State;->hasVideo()Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
:cond_2
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public final isMeUsingVideoInChannel(J)Z
|
|
.locals 3
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/stores/StoreAudioDevices$VideoUseDetector;->getVoiceStatesForChannel(J)Ljava/util/Map;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object p2, p0, Lcom/discord/stores/StoreAudioDevices$VideoUseDetector;->usersStore:Lcom/discord/stores/StoreUser;
|
|
|
|
invoke-virtual {p2}, Lcom/discord/stores/StoreUser;->getMeInternal$app_productionDiscordExternalRelease()Lcom/discord/models/domain/ModelUser$Me;
|
|
|
|
move-result-object p2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-virtual {p2}, Lcom/discord/models/domain/ModelUser;->getId()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-interface {p1, p2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/discord/models/domain/ModelVoice$State;
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelVoice$State;->hasVideo()Z
|
|
|
|
move-result v0
|
|
|
|
:cond_0
|
|
return v0
|
|
.end method
|