543 lines
10 KiB
Smali
543 lines
10 KiB
Smali
.class public final Lf/k/a/b/q;
|
|
.super Ljava/lang/Object;
|
|
.source "AudioFocusManager.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lf/k/a/b/q$a;,
|
|
Lf/k/a/b/q$b;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final a:Landroid/media/AudioManager;
|
|
|
|
.field public final b:Lf/k/a/b/q$a;
|
|
|
|
.field public final c:Lf/k/a/b/q$b;
|
|
|
|
.field public d:Lf/k/a/b/z0/i;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public e:I
|
|
|
|
.field public f:I
|
|
|
|
.field public g:F
|
|
|
|
.field public h:Landroid/media/AudioFocusRequest;
|
|
|
|
.field public i:Z
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/os/Handler;Lf/k/a/b/q$b;)V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
const/high16 v0, 0x3f800000 # 1.0f
|
|
|
|
iput v0, p0, Lf/k/a/b/q;->g:F
|
|
|
|
invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "audio"
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/media/AudioManager;
|
|
|
|
iput-object p1, p0, Lf/k/a/b/q;->a:Landroid/media/AudioManager;
|
|
|
|
iput-object p3, p0, Lf/k/a/b/q;->c:Lf/k/a/b/q$b;
|
|
|
|
new-instance p1, Lf/k/a/b/q$a;
|
|
|
|
invoke-direct {p1, p0, p2}, Lf/k/a/b/q$a;-><init>(Lf/k/a/b/q;Landroid/os/Handler;)V
|
|
|
|
iput-object p1, p0, Lf/k/a/b/q;->b:Lf/k/a/b/q$a;
|
|
|
|
const/4 p1, 0x0
|
|
|
|
iput p1, p0, Lf/k/a/b/q;->e:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final a()I
|
|
.locals 6
|
|
|
|
iget v0, p0, Lf/k/a/b/q;->f:I
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
iget v0, p0, Lf/k/a/b/q;->e:I
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p0, v1}, Lf/k/a/b/q;->a(Z)V
|
|
|
|
:cond_0
|
|
return v1
|
|
|
|
:cond_1
|
|
iget v0, p0, Lf/k/a/b/q;->e:I
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-nez v0, :cond_7
|
|
|
|
sget v0, Lf/k/a/b/l1/f0;->a:I
|
|
|
|
const/16 v3, 0x1a
|
|
|
|
if-lt v0, v3, :cond_5
|
|
|
|
iget-object v0, p0, Lf/k/a/b/q;->h:Landroid/media/AudioFocusRequest;
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
iget-boolean v0, p0, Lf/k/a/b/q;->i:Z
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
:cond_2
|
|
iget-object v0, p0, Lf/k/a/b/q;->h:Landroid/media/AudioFocusRequest;
|
|
|
|
if-nez v0, :cond_3
|
|
|
|
new-instance v0, Landroid/media/AudioFocusRequest$Builder;
|
|
|
|
iget v3, p0, Lf/k/a/b/q;->f:I
|
|
|
|
invoke-direct {v0, v3}, Landroid/media/AudioFocusRequest$Builder;-><init>(I)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
new-instance v3, Landroid/media/AudioFocusRequest$Builder;
|
|
|
|
invoke-direct {v3, v0}, Landroid/media/AudioFocusRequest$Builder;-><init>(Landroid/media/AudioFocusRequest;)V
|
|
|
|
move-object v0, v3
|
|
|
|
:goto_0
|
|
invoke-virtual {p0}, Lf/k/a/b/q;->b()Z
|
|
|
|
move-result v3
|
|
|
|
iget-object v4, p0, Lf/k/a/b/q;->d:Lf/k/a/b/z0/i;
|
|
|
|
invoke-static {v4}, Lf/k/a/b/l1/e;->a(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
invoke-virtual {v4}, Lf/k/a/b/z0/i;->a()Landroid/media/AudioAttributes;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v0, v4}, Landroid/media/AudioFocusRequest$Builder;->setAudioAttributes(Landroid/media/AudioAttributes;)Landroid/media/AudioFocusRequest$Builder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, v3}, Landroid/media/AudioFocusRequest$Builder;->setWillPauseWhenDucked(Z)Landroid/media/AudioFocusRequest$Builder;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v3, p0, Lf/k/a/b/q;->b:Lf/k/a/b/q$a;
|
|
|
|
invoke-virtual {v0, v3}, Landroid/media/AudioFocusRequest$Builder;->setOnAudioFocusChangeListener(Landroid/media/AudioManager$OnAudioFocusChangeListener;)Landroid/media/AudioFocusRequest$Builder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Landroid/media/AudioFocusRequest$Builder;->build()Landroid/media/AudioFocusRequest;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lf/k/a/b/q;->h:Landroid/media/AudioFocusRequest;
|
|
|
|
iput-boolean v2, p0, Lf/k/a/b/q;->i:Z
|
|
|
|
:cond_4
|
|
iget-object v0, p0, Lf/k/a/b/q;->a:Landroid/media/AudioManager;
|
|
|
|
iget-object v3, p0, Lf/k/a/b/q;->h:Landroid/media/AudioFocusRequest;
|
|
|
|
invoke-virtual {v0, v3}, Landroid/media/AudioManager;->requestAudioFocus(Landroid/media/AudioFocusRequest;)I
|
|
|
|
move-result v0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_5
|
|
iget-object v0, p0, Lf/k/a/b/q;->a:Landroid/media/AudioManager;
|
|
|
|
iget-object v3, p0, Lf/k/a/b/q;->b:Lf/k/a/b/q$a;
|
|
|
|
iget-object v4, p0, Lf/k/a/b/q;->d:Lf/k/a/b/z0/i;
|
|
|
|
invoke-static {v4}, Lf/k/a/b/l1/e;->a(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
iget v4, v4, Lf/k/a/b/z0/i;->c:I
|
|
|
|
invoke-static {v4}, Lf/k/a/b/l1/f0;->b(I)I
|
|
|
|
move-result v4
|
|
|
|
iget v5, p0, Lf/k/a/b/q;->f:I
|
|
|
|
invoke-virtual {v0, v3, v4, v5}, Landroid/media/AudioManager;->requestAudioFocus(Landroid/media/AudioManager$OnAudioFocusChangeListener;II)I
|
|
|
|
move-result v0
|
|
|
|
:goto_1
|
|
if-ne v0, v1, :cond_6
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_6
|
|
const/4 v0, 0x0
|
|
|
|
:goto_2
|
|
iput v0, p0, Lf/k/a/b/q;->e:I
|
|
|
|
:cond_7
|
|
iget v0, p0, Lf/k/a/b/q;->e:I
|
|
|
|
if-nez v0, :cond_8
|
|
|
|
const/4 v0, -0x1
|
|
|
|
return v0
|
|
|
|
:cond_8
|
|
const/4 v3, 0x2
|
|
|
|
if-ne v0, v3, :cond_9
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:cond_9
|
|
return v1
|
|
.end method
|
|
|
|
.method public a(ZI)I
|
|
.locals 2
|
|
|
|
const/4 v0, -0x1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
invoke-virtual {p0, p1}, Lf/k/a/b/q;->a(Z)V
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
const/4 v1, 0x1
|
|
|
|
if-ne p2, v1, :cond_1
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-virtual {p0}, Lf/k/a/b/q;->a()I
|
|
|
|
move-result v0
|
|
|
|
:cond_2
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public final a(I)V
|
|
.locals 6
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, -0x3
|
|
|
|
const/4 v3, 0x3
|
|
|
|
const/4 v4, 0x2
|
|
|
|
const/4 v5, -0x1
|
|
|
|
if-eq p1, v2, :cond_3
|
|
|
|
const/4 v2, -0x2
|
|
|
|
if-eq p1, v2, :cond_2
|
|
|
|
if-eq p1, v5, :cond_1
|
|
|
|
if-eq p1, v1, :cond_0
|
|
|
|
const-string v0, "Unknown focus change type: "
|
|
|
|
const-string v1, "AudioFocusManager"
|
|
|
|
invoke-static {v0, p1, v1}, Lf/e/b/a/a;->c(Ljava/lang/String;ILjava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
iput v1, p0, Lf/k/a/b/q;->e:I
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
iput v5, p0, Lf/k/a/b/q;->e:I
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
iput v4, p0, Lf/k/a/b/q;->e:I
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
iget-object p1, p0, Lf/k/a/b/q;->d:Lf/k/a/b/z0/i;
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
iget p1, p1, Lf/k/a/b/z0/i;->a:I
|
|
|
|
if-ne p1, v1, :cond_4
|
|
|
|
const/4 p1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
const/4 p1, 0x0
|
|
|
|
:goto_0
|
|
if-eqz p1, :cond_5
|
|
|
|
iput v4, p0, Lf/k/a/b/q;->e:I
|
|
|
|
goto :goto_1
|
|
|
|
:cond_5
|
|
iput v3, p0, Lf/k/a/b/q;->e:I
|
|
|
|
:goto_1
|
|
iget p1, p0, Lf/k/a/b/q;->e:I
|
|
|
|
if-eq p1, v5, :cond_9
|
|
|
|
if-eqz p1, :cond_a
|
|
|
|
if-eq p1, v1, :cond_8
|
|
|
|
if-eq p1, v4, :cond_7
|
|
|
|
if-ne p1, v3, :cond_6
|
|
|
|
goto :goto_2
|
|
|
|
:cond_6
|
|
new-instance p1, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v0, "Unknown audio focus state: "
|
|
|
|
invoke-static {v0}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
iget v1, p0, Lf/k/a/b/q;->e:I
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_7
|
|
iget-object p1, p0, Lf/k/a/b/q;->c:Lf/k/a/b/q$b;
|
|
|
|
check-cast p1, Lf/k/a/b/v0$b;
|
|
|
|
invoke-virtual {p1, v0}, Lf/k/a/b/v0$b;->e(I)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_8
|
|
iget-object p1, p0, Lf/k/a/b/q;->c:Lf/k/a/b/q$b;
|
|
|
|
check-cast p1, Lf/k/a/b/v0$b;
|
|
|
|
invoke-virtual {p1, v1}, Lf/k/a/b/v0$b;->e(I)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_9
|
|
iget-object p1, p0, Lf/k/a/b/q;->c:Lf/k/a/b/q$b;
|
|
|
|
check-cast p1, Lf/k/a/b/v0$b;
|
|
|
|
invoke-virtual {p1, v5}, Lf/k/a/b/v0$b;->e(I)V
|
|
|
|
invoke-virtual {p0, v1}, Lf/k/a/b/q;->a(Z)V
|
|
|
|
:cond_a
|
|
:goto_2
|
|
iget p1, p0, Lf/k/a/b/q;->e:I
|
|
|
|
if-ne p1, v3, :cond_b
|
|
|
|
const p1, 0x3e4ccccd # 0.2f
|
|
|
|
goto :goto_3
|
|
|
|
:cond_b
|
|
const/high16 p1, 0x3f800000 # 1.0f
|
|
|
|
:goto_3
|
|
iget v0, p0, Lf/k/a/b/q;->g:F
|
|
|
|
cmpl-float v0, v0, p1
|
|
|
|
if-eqz v0, :cond_c
|
|
|
|
iput p1, p0, Lf/k/a/b/q;->g:F
|
|
|
|
iget-object p1, p0, Lf/k/a/b/q;->c:Lf/k/a/b/q$b;
|
|
|
|
check-cast p1, Lf/k/a/b/v0$b;
|
|
|
|
iget-object p1, p1, Lf/k/a/b/v0$b;->d:Lf/k/a/b/v0;
|
|
|
|
invoke-virtual {p1}, Lf/k/a/b/v0;->C()V
|
|
|
|
:cond_c
|
|
return-void
|
|
.end method
|
|
|
|
.method public final a(Z)V
|
|
.locals 2
|
|
|
|
iget v0, p0, Lf/k/a/b/q;->f:I
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget v0, p0, Lf/k/a/b/q;->e:I
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
iget v0, p0, Lf/k/a/b/q;->f:I
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-ne v0, v1, :cond_1
|
|
|
|
iget v0, p0, Lf/k/a/b/q;->e:I
|
|
|
|
const/4 v1, -0x1
|
|
|
|
if-eq v0, v1, :cond_1
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
:cond_1
|
|
sget p1, Lf/k/a/b/l1/f0;->a:I
|
|
|
|
const/16 v0, 0x1a
|
|
|
|
if-lt p1, v0, :cond_2
|
|
|
|
iget-object p1, p0, Lf/k/a/b/q;->h:Landroid/media/AudioFocusRequest;
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
iget-object v0, p0, Lf/k/a/b/q;->a:Landroid/media/AudioManager;
|
|
|
|
invoke-virtual {v0, p1}, Landroid/media/AudioManager;->abandonAudioFocusRequest(Landroid/media/AudioFocusRequest;)I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
iget-object p1, p0, Lf/k/a/b/q;->a:Landroid/media/AudioManager;
|
|
|
|
iget-object v0, p0, Lf/k/a/b/q;->b:Lf/k/a/b/q$a;
|
|
|
|
invoke-virtual {p1, v0}, Landroid/media/AudioManager;->abandonAudioFocus(Landroid/media/AudioManager$OnAudioFocusChangeListener;)I
|
|
|
|
:cond_3
|
|
:goto_0
|
|
const/4 p1, 0x0
|
|
|
|
iput p1, p0, Lf/k/a/b/q;->e:I
|
|
|
|
:cond_4
|
|
return-void
|
|
.end method
|
|
|
|
.method public b(Z)I
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p0}, Lf/k/a/b/q;->a()I
|
|
|
|
move-result p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, -0x1
|
|
|
|
:goto_0
|
|
return p1
|
|
.end method
|
|
|
|
.method public final b()Z
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lf/k/a/b/q;->d:Lf/k/a/b/z0/i;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget v0, v0, Lf/k/a/b/z0/i;->a:I
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
return v1
|
|
.end method
|