309 lines
11 KiB
Smali
309 lines
11 KiB
Smali
.class public final Lcom/discord/utilities/voice/VoiceEngineForegroundService$Actions;
|
|
.super Ljava/lang/Object;
|
|
.source "VoiceEngineForegroundService.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/utilities/voice/VoiceEngineForegroundService;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "Actions"
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final INSTANCE:Lcom/discord/utilities/voice/VoiceEngineForegroundService$Actions;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Actions;
|
|
|
|
invoke-direct {v0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Actions;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Actions;->INSTANCE:Lcom/discord/utilities/voice/VoiceEngineForegroundService$Actions;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final bind(Landroid/content/Context;Landroid/content/ServiceConnection;)V
|
|
.locals 2
|
|
|
|
const-string v0, "DiscordVoiceService"
|
|
|
|
const-string v1, "Bind service connection."
|
|
|
|
invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
const-class v1, Lcom/discord/utilities/voice/VoiceEngineForegroundService;
|
|
|
|
invoke-direct {v0, p1, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-virtual {p1, v0, p2, v1}, Landroid/content/Context;->bindService(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final handleError(Ljava/lang/Exception;)V
|
|
.locals 2
|
|
|
|
const-string v0, "DiscordVoiceService"
|
|
|
|
const-string v1, "Unable to bind or unbind service connection."
|
|
|
|
invoke-static {v0, v1, p1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final unbind(Landroid/content/Context;Landroid/content/ServiceConnection;)V
|
|
.locals 2
|
|
|
|
const-string v0, "DiscordVoiceService"
|
|
|
|
const-string v1, "Unbind service connection."
|
|
|
|
invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
invoke-virtual {p1, p2}, Landroid/content/Context;->unbindService(Landroid/content/ServiceConnection;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final startForegroundAndBind(Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;Ljava/lang/String;Ljava/lang/String;ZZZJLjava/lang/Long;Z)V
|
|
.locals 3
|
|
|
|
const-string v0, "connection"
|
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string/jumbo v0, "title"
|
|
|
|
invoke-static {p2, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string/jumbo v0, "subtitle"
|
|
|
|
invoke-static {p3, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
:try_start_0
|
|
invoke-virtual {p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Landroid/content/Intent;
|
|
|
|
const-class v2, Lcom/discord/utilities/voice/VoiceEngineForegroundService;
|
|
|
|
invoke-direct {v1, v0, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
|
|
|
|
const-string v2, "com.discord.utilities.voice.action.start_foreground"
|
|
|
|
invoke-virtual {v1, v2}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
const-string v2, "com.discord.utilities.voice.extra.title"
|
|
|
|
invoke-virtual {v1, v2, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
const-string p2, "com.discord.utilities.voice.extra.title_subtext"
|
|
|
|
invoke-virtual {v1, p2, p3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
const-string p2, "com.discord.utilities.voice.extra.item_muted"
|
|
|
|
invoke-virtual {v1, p2, p4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
|
|
|
|
const-string p2, "com.discord.utilities.voice.extra.item_deafened"
|
|
|
|
invoke-virtual {v1, p2, p5}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
|
|
|
|
const-string p2, "com.discord.utilities.voice.extra.item_streaming"
|
|
|
|
invoke-virtual {v1, p2, p6}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
|
|
|
|
const-string p2, "com.discord.utilities.voice.extra.proximity_lock_enabled"
|
|
|
|
invoke-virtual {v1, p2, p10}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
|
|
|
|
const-string p2, "com.discord.utilities.voice.extra.channel_id"
|
|
|
|
invoke-virtual {v1, p2, p7, p8}, Landroid/content/Intent;->putExtra(Ljava/lang/String;J)Landroid/content/Intent;
|
|
|
|
const-string p2, "com.discord.utilities.voice.extra.guild_id"
|
|
|
|
invoke-virtual {v1, p2, p9}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;->getConnection()Landroid/content/ServiceConnection;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p2, p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Actions;->bind(Landroid/content/Context;Landroid/content/ServiceConnection;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Actions;->handleError(Ljava/lang/Exception;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public final startStream(Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;Landroid/content/Intent;)V
|
|
.locals 2
|
|
|
|
const-string v0, "connection"
|
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "permissionIntent"
|
|
|
|
invoke-static {p2, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
const-class v1, Lcom/discord/utilities/voice/VoiceEngineForegroundService;
|
|
|
|
invoke-direct {v0, p1, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
|
|
|
|
const-string v1, "com.discord.utilities.voice.action.start_stream"
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
const-string v1, "android.intent.extra.INTENT"
|
|
|
|
invoke-virtual {v0, v1, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final stopForegroundAndUnbind(Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;)V
|
|
.locals 3
|
|
|
|
const-string v0, "connection"
|
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
:try_start_0
|
|
invoke-virtual {p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;->getService()Lcom/discord/utilities/voice/VoiceEngineForegroundService;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Landroid/content/Intent;
|
|
|
|
const-class v2, Lcom/discord/utilities/voice/VoiceEngineForegroundService;
|
|
|
|
invoke-direct {v1, v0, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
|
|
|
|
const-string v2, "com.discord.utilities.voice.action.stop"
|
|
|
|
invoke-virtual {v1, v2}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;
|
|
|
|
:cond_0
|
|
invoke-virtual {p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;->isServiceBound()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;->isUnbinding()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-virtual {p1, v0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;->setUnbinding(Z)V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;->getConnection()Landroid/content/ServiceConnection;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, v0, p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Actions;->unbind(Landroid/content/Context;Landroid/content/ServiceConnection;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Actions;->handleError(Ljava/lang/Exception;)V
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public final stopStream(Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;)V
|
|
.locals 2
|
|
|
|
const-string v0, "connection"
|
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
const-class v1, Lcom/discord/utilities/voice/VoiceEngineForegroundService;
|
|
|
|
invoke-direct {v0, p1, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
|
|
|
|
const-string v1, "com.discord.utilities.voice.action.stop_stream"
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;
|
|
|
|
return-void
|
|
.end method
|