281 lines
8.1 KiB
Smali
281 lines
8.1 KiB
Smali
.class public final Lcom/discord/utilities/voice/DiscordOverlayService$Companion;
|
|
.super Ljava/lang/Object;
|
|
.source "DiscordOverlayService.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/utilities/voice/DiscordOverlayService;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "Companion"
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/utilities/voice/DiscordOverlayService$Companion;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$createOverlayIntent(Lcom/discord/utilities/voice/DiscordOverlayService$Companion;Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/utilities/voice/DiscordOverlayService$Companion;->createOverlayIntent(Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final createOverlayIntent(Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;
|
|
.locals 3
|
|
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
const-class v1, Lcom/discord/utilities/voice/DiscordOverlayService;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-direct {v0, p2, v2, p1, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;Landroid/content/Context;Ljava/lang/Class;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final launchForConnect(Landroid/content/Context;)V
|
|
.locals 12
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
sget-object v1, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreStream$Companion;->getUserSettings()Lcom/discord/stores/StoreUserSettings;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreUserSettings;->getMobileOverlay()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const v1, 0x7f121099
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/16 v3, 0x8
|
|
|
|
invoke-static {p1, v1, v2, v0, v3}, Lf/a/b/n;->j(Landroid/content/Context;IILcom/discord/utilities/view/ToastManager;I)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/ref/WeakReference;
|
|
|
|
invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V
|
|
|
|
sget-object v1, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreStream$Companion;->getRtcConnection()Lcom/discord/stores/StoreRtcConnection;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreRtcConnection;->getConnectionState()Lrx/Observable;
|
|
|
|
move-result-object v2
|
|
|
|
const-wide/16 v3, 0x3e8
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x2
|
|
|
|
const/4 v7, 0x0
|
|
|
|
invoke-static/range {v2 .. v7}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->takeSingleUntilTimeout$default(Lrx/Observable;JZILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v2, Lcom/discord/utilities/voice/DiscordOverlayService$Companion$launchForConnect$1;->INSTANCE:Lcom/discord/utilities/voice/DiscordOverlayService$Companion$launchForConnect$1;
|
|
|
|
invoke-virtual {v1, v2}, Lrx/Observable;->E(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "StoreStream\n .g\u2026 }\n }"
|
|
|
|
invoke-static {v1, v2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object v3
|
|
|
|
const-class v4, Lcom/discord/utilities/voice/DiscordOverlayService;
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
new-instance v9, Lcom/discord/utilities/voice/DiscordOverlayService$Companion$launchForConnect$2;
|
|
|
|
invoke-direct {v9, p1, v0}, Lcom/discord/utilities/voice/DiscordOverlayService$Companion$launchForConnect$2;-><init>(Landroid/content/Context;Ljava/lang/ref/WeakReference;)V
|
|
|
|
const/16 v10, 0x1c
|
|
|
|
const/4 v11, 0x0
|
|
|
|
move-object v5, p1
|
|
|
|
invoke-static/range {v3 .. v11}, 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
|
|
|
|
:cond_1
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final launchForVoiceChannelSelect(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getUserSettings()Lcom/discord/stores/StoreUserSettings;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreUserSettings;->getMobileOverlay()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const-string v0, "com.discord.actions.OVERLAY_SELECTOR"
|
|
|
|
invoke-direct {p0, p1, v0}, Lcom/discord/utilities/voice/DiscordOverlayService$Companion;->createOverlayIntent(Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;
|
|
|
|
:cond_0
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final launchOverlayForVoice(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getUserSettings()Lcom/discord/stores/StoreUserSettings;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreUserSettings;->getMobileOverlay()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const-string v0, "com.discord.actions.OVERLAY_VOICE"
|
|
|
|
invoke-direct {p0, p1, v0}, Lcom/discord/utilities/voice/DiscordOverlayService$Companion;->createOverlayIntent(Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;
|
|
|
|
:cond_0
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final requestOverlayClose(Landroid/content/Context;)V
|
|
.locals 6
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
:try_start_0
|
|
const-string v0, "com.discord.actions.OVERLAY_CLOSE"
|
|
|
|
invoke-direct {p0, p1, v0}, Lcom/discord/utilities/voice/DiscordOverlayService$Companion;->createOverlayIntent(Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
move-object v2, p1
|
|
|
|
sget-object v0, Lcom/discord/app/AppLog;->d:Lcom/discord/app/AppLog;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x4
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const-string v1, "Overlay close request failed."
|
|
|
|
invoke-static/range {v0 .. v5}, Lcom/discord/utilities/logging/Logger;->e$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/Map;ILjava/lang/Object;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|