2020-05-17 12:40:10 +00:00
|
|
|
.class public final Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "StoreAudioManager.kt"
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation build Landroidx/annotation/VisibleForTesting;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
|
|
value = Lcom/discord/stores/StoreAudioManager;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
|
|
accessFlags = 0x19
|
|
|
|
name = "MediaEngineAudioManager"
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
|
|
value = {
|
|
|
|
Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$Configuration;,
|
|
|
|
Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$AudioManagerSettings;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
|
|
|
.field public final audioManager:Landroid/media/AudioManager;
|
|
|
|
|
|
|
|
.field public initialAudioManagerSettings:Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$AudioManagerSettings;
|
|
|
|
|
|
|
|
.field public isBluetoothScoStarted:Z
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public constructor <init>(Landroid/media/AudioManager;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->audioManager:Landroid/media/AudioManager;
|
|
|
|
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/media/AudioManager;->isBluetoothScoOn()Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
iput-boolean p1, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->isBluetoothScoStarted:Z
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final extractSettings(Landroid/media/AudioManager;)Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$AudioManagerSettings;
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$AudioManagerSettings;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/media/AudioManager;->isSpeakerphoneOn()Z
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/media/AudioManager;->getMode()I
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/media/AudioManager;->isBluetoothScoOn()Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
invoke-direct {v0, v1, v2, p1}, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$AudioManagerSettings;-><init>(ZIZ)V
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final startBluetoothSCO(Landroid/media/AudioManager;)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/media/AudioManager;->startBluetoothSco()V
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
invoke-virtual {p1, v0}, Landroid/media/AudioManager;->setBluetoothScoOn(Z)V
|
|
|
|
|
|
|
|
iput-boolean v0, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->isBluetoothScoStarted:Z
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final stopBluetoothSCO(Landroid/media/AudioManager;)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/media/AudioManager;->stopBluetoothSco()V
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
invoke-virtual {p1, v0}, Landroid/media/AudioManager;->setBluetoothScoOn(Z)V
|
|
|
|
|
|
|
|
iput-boolean v0, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->isBluetoothScoStarted:Z
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final trySetMode(Landroid/media/AudioManager;I)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
invoke-virtual {p1, p2}, Landroid/media/AudioManager;->setMode(I)V
|
|
|
|
:try_end_0
|
|
|
|
.catch Ljava/lang/SecurityException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
:catch_0
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
.method private final useSettings(Landroid/media/AudioManager;Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$AudioManagerSettings;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
.locals 1
|
|
|
|
|
|
|
|
invoke-virtual {p2}, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$AudioManagerSettings;->getSettingBluetoothScoOn()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
iget-boolean v0, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->isBluetoothScoStarted:Z
|
|
|
|
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->startBluetoothSCO(Landroid/media/AudioManager;)V
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget-boolean v0, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->isBluetoothScoStarted:Z
|
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->stopBluetoothSCO(Landroid/media/AudioManager;)V
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
:goto_0
|
|
|
|
invoke-virtual {p2}, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$AudioManagerSettings;->getSettingSpeakerPhoneOn()Z
|
|
|
|
|
|
|
|
move-result p2
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-virtual {p1, p2}, Landroid/media/AudioManager;->setSpeakerphoneOn(Z)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public final configure(Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$Configuration;)V
|
2020-10-08 22:28:01 +00:00
|
|
|
.locals 5
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
const-string v0, "configuration"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->audioManager:Landroid/media/AudioManager;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
if-nez v0, :cond_0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$Configuration;->component1()Lcom/discord/rtcconnection/RtcConnection$State;
|
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
move-result-object v0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$Configuration;->component2()Lcom/discord/stores/StoreAudioDevices$AudioDevicesState;
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
move-result-object p1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->audioManager:Landroid/media/AudioManager;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
sget-object v2, Lcom/discord/rtcconnection/RtcConnection$State$f;->a:Lcom/discord/rtcconnection/RtcConnection$State$f;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {v0, v2}, Lc0/n/c/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
2020-08-20 22:29:33 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
move-result v2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
const/4 v3, 0x0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
const/4 v4, 0x3
|
|
|
|
|
|
|
|
if-eqz v2, :cond_1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
2020-10-08 22:28:01 +00:00
|
|
|
sget-object v2, Lcom/discord/rtcconnection/RtcConnection$State$g;->a:Lcom/discord/rtcconnection/RtcConnection$State$g;
|
|
|
|
|
|
|
|
invoke-static {v0, v2}, Lc0/n/c/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
sget-object v2, Lcom/discord/rtcconnection/RtcConnection$State$c;->a:Lcom/discord/rtcconnection/RtcConnection$State$c;
|
|
|
|
|
|
|
|
invoke-static {v0, v2}, Lc0/n/c/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
if-eqz v2, :cond_3
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-08-20 19:28:48 +00:00
|
|
|
:goto_0
|
2020-10-08 22:28:01 +00:00
|
|
|
const/4 v3, 0x3
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
instance-of v2, v0, Lcom/discord/rtcconnection/RtcConnection$State$d;
|
|
|
|
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
|
|
|
|
move-object v2, v0
|
|
|
|
|
|
|
|
check-cast v2, Lcom/discord/rtcconnection/RtcConnection$State$d;
|
|
|
|
|
|
|
|
iget-boolean v2, v2, Lcom/discord/rtcconnection/RtcConnection$State$d;->a:Z
|
|
|
|
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
:goto_1
|
|
|
|
invoke-virtual {v1, v3}, Landroid/media/AudioManager;->setMode(I)V
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
sget-object v1, Lcom/discord/rtcconnection/RtcConnection$State$f;->a:Lcom/discord/rtcconnection/RtcConnection$State$f;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
if-ne v0, v1, :cond_8
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-virtual {p1}, Lcom/discord/stores/StoreAudioDevices$AudioDevicesState;->getAudioOutputState()Lcom/discord/utilities/media/AudioOutputState;
|
2020-08-20 22:29:33 +00:00
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
move-result-object v0
|
2020-08-20 22:29:33 +00:00
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-virtual {p1}, Lcom/discord/stores/StoreAudioDevices$AudioDevicesState;->getSelectedOutputDevice()Lcom/discord/stores/StoreAudioDevices$OutputDevice;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
move-result-object p1
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->initialAudioManagerSettings:Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$AudioManagerSettings;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
if-eqz v1, :cond_5
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
goto :goto_2
|
2020-08-20 22:29:33 +00:00
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
:cond_5
|
2020-08-20 22:29:33 +00:00
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->audioManager:Landroid/media/AudioManager;
|
|
|
|
|
|
|
|
invoke-direct {p0, v1}, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->extractSettings(Landroid/media/AudioManager;)Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$AudioManagerSettings;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
:goto_2
|
2020-08-20 22:29:33 +00:00
|
|
|
iput-object v1, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->initialAudioManagerSettings:Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$AudioManagerSettings;
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->audioManager:Landroid/media/AudioManager;
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
instance-of v2, p1, Lcom/discord/stores/StoreAudioDevices$OutputDevice$Speaker;
|
2020-08-20 22:29:33 +00:00
|
|
|
|
|
|
|
invoke-virtual {v1, v2}, Landroid/media/AudioManager;->setSpeakerphoneOn(Z)V
|
|
|
|
|
|
|
|
iget-boolean v1, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->isBluetoothScoStarted:Z
|
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
if-eqz v1, :cond_7
|
2020-08-20 22:29:33 +00:00
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
instance-of p1, p1, Lcom/discord/stores/StoreAudioDevices$OutputDevice$BluetoothAudio;
|
2020-08-20 22:29:33 +00:00
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
if-eqz p1, :cond_6
|
2020-08-20 22:29:33 +00:00
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/media/AudioOutputState;->isBluetoothOutputConnected()Z
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
if-nez p1, :cond_a
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
:cond_6
|
2020-05-17 12:40:10 +00:00
|
|
|
iget-object p1, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->audioManager:Landroid/media/AudioManager;
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->stopBluetoothSCO(Landroid/media/AudioManager;)V
|
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
goto :goto_3
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
:cond_7
|
2020-09-02 04:07:20 +00:00
|
|
|
instance-of p1, p1, Lcom/discord/stores/StoreAudioDevices$OutputDevice$BluetoothAudio;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
if-eqz p1, :cond_a
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/media/AudioOutputState;->getCanBluetoothScoStart()Z
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
if-eqz p1, :cond_a
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
iget-object p1, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->audioManager:Landroid/media/AudioManager;
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->startBluetoothSCO(Landroid/media/AudioManager;)V
|
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
goto :goto_3
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
:cond_8
|
2020-09-02 04:07:20 +00:00
|
|
|
iget-object p1, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->initialAudioManagerSettings:Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$AudioManagerSettings;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
if-eqz p1, :cond_9
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->audioManager:Landroid/media/AudioManager;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
invoke-direct {p0, v0, p1}, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->useSettings(Landroid/media/AudioManager;Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$AudioManagerSettings;)V
|
2020-08-20 22:29:33 +00:00
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
:cond_9
|
2020-09-16 23:45:23 +00:00
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager;->initialAudioManagerSettings:Lcom/discord/stores/StoreAudioManager$MediaEngineAudioManager$AudioManagerSettings;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-08 22:28:01 +00:00
|
|
|
:cond_a
|
|
|
|
:goto_3
|
2020-05-17 12:40:10 +00:00
|
|
|
return-void
|
|
|
|
.end method
|