240 lines
5.2 KiB
Smali
240 lines
5.2 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 voiceStatesStore:Lcom/discord/stores/StoreVoiceStates;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lcom/discord/stores/StoreChannels;Lcom/discord/stores/StoreVoiceStates;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
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;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "voiceStatesStore"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "channelsStore"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final isAnyoneUsingVideoInChannel(J)Z
|
|
.locals 8
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.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;->getBlocking$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;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
new-instance v3, Ljava/util/LinkedHashMap;
|
|
|
|
invoke-direct {v3}, 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 v4
|
|
|
|
if-eqz v4, :cond_5
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Ljava/util/Map$Entry;
|
|
|
|
invoke-interface {v4}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
check-cast v5, Lcom/discord/models/domain/ModelVoice$State;
|
|
|
|
invoke-virtual {v5}, Lcom/discord/models/domain/ModelVoice$State;->getChannelId()Ljava/lang/Long;
|
|
|
|
move-result-object v5
|
|
|
|
if-nez v5, :cond_2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
invoke-virtual {v5}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v5
|
|
|
|
cmp-long v7, v5, p1
|
|
|
|
if-nez v7, :cond_3
|
|
|
|
const/4 v5, 0x1
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
:goto_2
|
|
const/4 v5, 0x0
|
|
|
|
:goto_3
|
|
if-eqz v5, :cond_1
|
|
|
|
invoke-interface {v4}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-interface {v4}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v3, v5, v4}, Ljava/util/LinkedHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
sget-object v3, Lj0/i/p;->d:Lj0/i/p;
|
|
|
|
:cond_5
|
|
invoke-interface {v3}, Ljava/util/Map;->values()Ljava/util/Collection;
|
|
|
|
move-result-object p1
|
|
|
|
instance-of p2, p1, Ljava/util/Collection;
|
|
|
|
if-eqz p2, :cond_7
|
|
|
|
invoke-interface {p1}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_7
|
|
|
|
:cond_6
|
|
const/4 v1, 0x0
|
|
|
|
goto :goto_6
|
|
|
|
:cond_7
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_8
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_6
|
|
|
|
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;->isSelfVideo()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_a
|
|
|
|
invoke-virtual {p2}, Lcom/discord/models/domain/ModelVoice$State;->isSelfStream()Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_9
|
|
|
|
goto :goto_4
|
|
|
|
:cond_9
|
|
const/4 p2, 0x0
|
|
|
|
goto :goto_5
|
|
|
|
:cond_a
|
|
:goto_4
|
|
const/4 p2, 0x1
|
|
|
|
:goto_5
|
|
if-eqz p2, :cond_8
|
|
|
|
:goto_6
|
|
return v1
|
|
.end method
|