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


# instance fields
.field public final a:Lz5/a4;

.field public final b:Lz5/z3;

.field public c:I

.field public d:Ljava/lang/Object;

.field public final e:Landroid/os/Looper;

.field public f:Z

.field public g:Z

.field public h:Z


# direct methods
.method public constructor <init>(Lz5/z3;Lz5/a4;Lz5/r4;ILz5/p6;Landroid/os/Looper;)V
    .registers 7

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

    iput-object p1, p0, Lz5/b4;->b:Lz5/z3;

    iput-object p2, p0, Lz5/b4;->a:Lz5/a4;

    iput-object p6, p0, Lz5/b4;->e:Landroid/os/Looper;

    return-void
.end method


# virtual methods
.method public final a()Landroid/os/Looper;
    .registers 2

    iget-object v0, p0, Lz5/b4;->e:Landroid/os/Looper;

    return-object v0
.end method

.method public final b()Lz5/b4;
    .registers 4

    iget-boolean v0, p0, Lz5/b4;->f:Z

    const/4 v1, 0x1

    xor-int/2addr v0, v1

    invoke-static {v0}, Lcom/google/android/gms/internal/ads/d;->n(Z)V

    iput-boolean v1, p0, Lz5/b4;->f:Z

    iget-object v0, p0, Lz5/b4;->b:Lz5/z3;

    check-cast v0, Lz5/t2;

    .line 1
    monitor-enter v0

    :try_start_e
    iget-boolean v1, v0, Lz5/t2;->N:Z

    if-nez v1, :cond_29

    iget-object v1, v0, Lz5/t2;->z:Landroid/os/HandlerThread;

    invoke-virtual {v1}, Landroid/os/HandlerThread;->isAlive()Z

    move-result v1

    if-nez v1, :cond_1b

    goto :goto_29

    :cond_1b
    iget-object v1, v0, Lz5/t2;->y:Lz5/v6;

    const/16 v2, 0xe

    check-cast v1, Lz5/n7;

    invoke-virtual {v1, v2, p0}, Lz5/n7;->b(ILjava/lang/Object;)Lz5/m7;

    move-result-object v1

    invoke-virtual {v1}, Lz5/m7;->a()V

    goto :goto_34

    :cond_29
    :goto_29
    const-string v1, "ExoPlayerImplInternal"

    const-string v2, "Ignoring messages sent after release."

    invoke-static {v1, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    const/4 v1, 0x0

    invoke-virtual {p0, v1}, Lz5/b4;->c(Z)V
    :try_end_34
    .catchall {:try_start_e .. :try_end_34} :catchall_36

    :goto_34
    monitor-exit v0

    return-object p0

    :catchall_36
    move-exception v1

    monitor-exit v0

    throw v1
.end method

.method public final declared-synchronized c(Z)V
    .registers 3

    monitor-enter p0

    :try_start_1
    iget-boolean v0, p0, Lz5/b4;->g:Z

    or-int/2addr p1, v0

    iput-boolean p1, p0, Lz5/b4;->g:Z

    const/4 p1, 0x1

    iput-boolean p1, p0, Lz5/b4;->h:Z

    invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
    :try_end_c
    .catchall {:try_start_1 .. :try_end_c} :catchall_e

    monitor-exit p0

    return-void

    :catchall_e
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public final declared-synchronized d()Z
    .registers 7

    monitor-enter p0

    :try_start_1
    iget-boolean v0, p0, Lz5/b4;->f:Z

    invoke-static {v0}, Lcom/google/android/gms/internal/ads/d;->n(Z)V

    iget-object v0, p0, Lz5/b4;->e:Landroid/os/Looper;

    invoke-virtual {v0}, Landroid/os/Looper;->getThread()Ljava/lang/Thread;

    move-result-object v0

    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object v1

    if-eq v0, v1, :cond_14

    const/4 v0, 0x1

    goto :goto_15

    :cond_14
    const/4 v0, 0x0

    :goto_15
    invoke-static {v0}, Lcom/google/android/gms/internal/ads/d;->n(Z)V

    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J

    move-result-wide v0

    const-wide/16 v2, 0x7d0

    add-long/2addr v0, v2

    :goto_1f
    iget-boolean v4, p0, Lz5/b4;->h:Z

    if-nez v4, :cond_3b

    const-wide/16 v4, 0x0

    cmp-long v4, v2, v4

    if-lez v4, :cond_33

    invoke-virtual {p0, v2, v3}, Ljava/lang/Object;->wait(J)V

    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J

    move-result-wide v2

    sub-long v2, v0, v2

    goto :goto_1f

    :cond_33
    new-instance v0, Ljava/util/concurrent/TimeoutException;

    const-string v1, "Message delivery timed out."

    invoke-direct {v0, v1}, Ljava/util/concurrent/TimeoutException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_3b
    iget-boolean v0, p0, Lz5/b4;->g:Z
    :try_end_3d
    .catchall {:try_start_1 .. :try_end_3d} :catchall_3f

    monitor-exit p0

    return v0

    :catchall_3f
    move-exception v0

    monitor-exit p0

    throw v0
.end method
