.class public final Lz5/n4;
.super Ljava/lang/Object;
.source ""


# instance fields
.field public final a:Landroid/content/Context;

.field public final b:Landroid/os/Handler;

.field public final c:Lz5/m4;

.field public final d:Landroid/media/AudioManager;

.field public e:Lz5/f0;

.field public f:I

.field public g:I

.field public h:Z


# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/os/Handler;Lz5/m4;)V
    .registers 5

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object p1

    iput-object p1, p0, Lz5/n4;->a:Landroid/content/Context;

    iput-object p2, p0, Lz5/n4;->b:Landroid/os/Handler;

    iput-object p3, p0, Lz5/n4;->c:Lz5/m4;

    const-string p2, "audio"

    invoke-virtual {p1, p2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object p2

    check-cast p2, Landroid/media/AudioManager;

    invoke-static {p2}, Lcom/google/android/gms/internal/ads/d;->p(Ljava/lang/Object;)Ljava/lang/Object;

    iput-object p2, p0, Lz5/n4;->d:Landroid/media/AudioManager;

    const/4 p3, 0x3

    iput p3, p0, Lz5/n4;->f:I

    invoke-static {p2, p3}, Lz5/n4;->c(Landroid/media/AudioManager;I)I

    move-result p3

    iput p3, p0, Lz5/n4;->g:I

    iget p3, p0, Lz5/n4;->f:I

    invoke-static {p2, p3}, Lz5/n4;->d(Landroid/media/AudioManager;I)Z

    move-result p2

    iput-boolean p2, p0, Lz5/n4;->h:Z

    new-instance p2, Lz5/f0;

    invoke-direct {p2, p0}, Lz5/f0;-><init>(Lz5/n4;)V

    new-instance p3, Landroid/content/IntentFilter;

    const-string v0, "android.media.VOLUME_CHANGED_ACTION"

    invoke-direct {p3, v0}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    :try_start_37
    invoke-virtual {p1, p2, p3}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    iput-object p2, p0, Lz5/n4;->e:Lz5/f0;
    :try_end_3c
    .catch Ljava/lang/RuntimeException; {:try_start_37 .. :try_end_3c} :catch_3d

    return-void

    :catch_3d
    move-exception p1

    const-string p2, "StreamVolumeManager"

    const-string p3, "Error registering stream volume receiver"

    invoke-static {p2, p3, p1}, Lcom/google/android/gms/internal/ads/f;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    return-void
.end method

.method public static c(Landroid/media/AudioManager;I)I
    .registers 5

    :try_start_0
    invoke-virtual {p0, p1}, Landroid/media/AudioManager;->getStreamVolume(I)I

    move-result p0
    :try_end_4
    .catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_4} :catch_5

    return p0

    :catch_5
    move-exception v0

    new-instance v1, Ljava/lang/StringBuilder;

    const/16 v2, 0x3c

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(I)V

    const-string v2, "Could not retrieve stream volume for stream type "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    const-string v2, "StreamVolumeManager"

    invoke-static {v2, v1, v0}, Lcom/google/android/gms/internal/ads/f;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    invoke-virtual {p0, p1}, Landroid/media/AudioManager;->getStreamMaxVolume(I)I

    move-result p0

    return p0
.end method

.method public static d(Landroid/media/AudioManager;I)Z
    .registers 4

    sget v0, Lz5/r7;->a:I

    const/16 v1, 0x17

    if-lt v0, v1, :cond_b

    invoke-virtual {p0, p1}, Landroid/media/AudioManager;->isStreamMute(I)Z

    move-result p0

    return p0

    :cond_b
    invoke-static {p0, p1}, Lz5/n4;->c(Landroid/media/AudioManager;I)I

    move-result p0

    if-nez p0, :cond_13

    const/4 p0, 0x1

    return p0

    :cond_13
    const/4 p0, 0x0

    return p0
.end method


# virtual methods
.method public final a(I)V
    .registers 4

    iget p1, p0, Lz5/n4;->f:I

    const/4 v0, 0x3

    if-ne p1, v0, :cond_6

    return-void

    :cond_6
    iput v0, p0, Lz5/n4;->f:I

    invoke-virtual {p0}, Lz5/n4;->b()V

    iget-object p1, p0, Lz5/n4;->c:Lz5/m4;

    check-cast p1, Lz5/j4;

    iget-object v0, p1, Lz5/j4;->r:Lz5/l4;

    .line 1
    iget-object v0, v0, Lz5/l4;->A:Lz5/n4;

    .line 2
    invoke-static {v0}, Lz5/l4;->V(Lz5/n4;)Lz5/b2;

    move-result-object v0

    .line 3
    iget-object v1, p1, Lz5/j4;->r:Lz5/l4;

    .line 4
    iget-object v1, v1, Lz5/l4;->O:Lz5/b2;

    .line 5
    invoke-virtual {v0, v1}, Lz5/b2;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_3b

    iget-object p1, p1, Lz5/j4;->r:Lz5/l4;

    .line 6
    iput-object v0, p1, Lz5/l4;->O:Lz5/b2;

    .line 7
    iget-object p1, p1, Lz5/l4;->x:Ljava/util/concurrent/CopyOnWriteArraySet;

    .line 8
    invoke-virtual {p1}, Ljava/util/concurrent/CopyOnWriteArraySet;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :goto_2b
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_3b

    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lz5/x3;

    invoke-interface {v1, v0}, Lz5/x3;->R(Lz5/b2;)V

    goto :goto_2b

    :cond_3b
    return-void
.end method

.method public final b()V
    .registers 5

    iget-object v0, p0, Lz5/n4;->d:Landroid/media/AudioManager;

    iget v1, p0, Lz5/n4;->f:I

    invoke-static {v0, v1}, Lz5/n4;->c(Landroid/media/AudioManager;I)I

    move-result v0

    iget-object v1, p0, Lz5/n4;->d:Landroid/media/AudioManager;

    iget v2, p0, Lz5/n4;->f:I

    invoke-static {v1, v2}, Lz5/n4;->d(Landroid/media/AudioManager;I)Z

    move-result v1

    iget v2, p0, Lz5/n4;->g:I

    if-ne v2, v0, :cond_18

    iget-boolean v2, p0, Lz5/n4;->h:Z

    if-eq v2, v1, :cond_38

    :cond_18
    iput v0, p0, Lz5/n4;->g:I

    iput-boolean v1, p0, Lz5/n4;->h:Z

    iget-object v2, p0, Lz5/n4;->c:Lz5/m4;

    check-cast v2, Lz5/j4;

    iget-object v2, v2, Lz5/j4;->r:Lz5/l4;

    .line 1
    iget-object v2, v2, Lz5/l4;->x:Ljava/util/concurrent/CopyOnWriteArraySet;

    .line 2
    invoke-virtual {v2}, Ljava/util/concurrent/CopyOnWriteArraySet;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_28
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_38

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lz5/x3;

    invoke-interface {v3, v0, v1}, Lz5/x3;->J(IZ)V

    goto :goto_28

    :cond_38
    return-void
.end method
