.class public final Ll5/n;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Landroid/content/ServiceConnection;


# instance fields
.field public r:I
    .annotation build Ljavax/annotation/concurrent/GuardedBy;
        value = "this"
    .end annotation
.end field

.field public final s:Landroid/os/Messenger;

.field public t:Landroidx/appcompat/widget/d0;

.field public final u:Ljava/util/Queue;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Queue<",
            "Ll5/q<",
            "*>;>;"
        }
    .end annotation

    .annotation build Ljavax/annotation/concurrent/GuardedBy;
        value = "this"
    .end annotation
.end field

.field public final v:Landroid/util/SparseArray;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/util/SparseArray<",
            "Ll5/q<",
            "*>;>;"
        }
    .end annotation

    .annotation build Ljavax/annotation/concurrent/GuardedBy;
        value = "this"
    .end annotation
.end field

.field public final synthetic w:Ll5/t;


# direct methods
.method public synthetic constructor <init>(Ll5/t;)V
    .registers 5

    iput-object p1, p0, Ll5/n;->w:Ll5/t;

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

    const/4 p1, 0x0

    iput p1, p0, Ll5/n;->r:I

    new-instance p1, Landroid/os/Messenger;

    new-instance v0, Ld6/c;

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v1

    new-instance v2, Ll5/j;

    invoke-direct {v2, p0}, Ll5/j;-><init>(Ll5/n;)V

    invoke-direct {v0, v1, v2}, Ld6/c;-><init>(Landroid/os/Looper;Landroid/os/Handler$Callback;)V

    invoke-direct {p1, v0}, Landroid/os/Messenger;-><init>(Landroid/os/Handler;)V

    iput-object p1, p0, Ll5/n;->s:Landroid/os/Messenger;

    new-instance p1, Ljava/util/ArrayDeque;

    invoke-direct {p1}, Ljava/util/ArrayDeque;-><init>()V

    iput-object p1, p0, Ll5/n;->u:Ljava/util/Queue;

    new-instance p1, Landroid/util/SparseArray;

    invoke-direct {p1}, Landroid/util/SparseArray;-><init>()V

    iput-object p1, p0, Ll5/n;->v:Landroid/util/SparseArray;

    return-void
.end method


# virtual methods
.method public final declared-synchronized a(ILjava/lang/String;)V
    .registers 4

    monitor-enter p0

    const/4 v0, 0x0

    :try_start_2
    invoke-virtual {p0, p1, p2, v0}, Ll5/n;->b(ILjava/lang/String;Ljava/lang/Throwable;)V
    :try_end_5
    .catchall {:try_start_2 .. :try_end_5} :catchall_7

    monitor-exit p0

    return-void

    :catchall_7
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public final declared-synchronized b(ILjava/lang/String;Ljava/lang/Throwable;)V
    .registers 8

    monitor-enter p0

    :try_start_1
    const-string p1, "MessengerIpcClient"

    const/4 v0, 0x3

    invoke-static {p1, v0}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result p1

    if-eqz p1, :cond_25

    invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p1

    const-string v1, "Disconnected: "

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v2

    if-eqz v2, :cond_1b

    invoke-virtual {v1, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    goto :goto_20

    :cond_1b
    new-instance p1, Ljava/lang/String;

    invoke-direct {p1, v1}, Ljava/lang/String;-><init>(Ljava/lang/String;)V

    :goto_20
    const-string v1, "MessengerIpcClient"

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

    :cond_25
    iget p1, p0, Ll5/n;->r:I
    :try_end_27
    .catchall {:try_start_1 .. :try_end_27} :catchall_98

    if-eqz p1, :cond_92

    const/4 v1, 0x4

    const/4 v2, 0x2

    const/4 v3, 0x1

    if-eq p1, v3, :cond_38

    if-eq p1, v2, :cond_38

    if-eq p1, v0, :cond_34

    monitor-exit p0

    return-void

    :cond_34
    :try_start_34
    iput v1, p0, Ll5/n;->r:I
    :try_end_36
    .catchall {:try_start_34 .. :try_end_36} :catchall_98

    monitor-exit p0

    return-void

    :cond_38
    :try_start_38
    const-string p1, "MessengerIpcClient"

    invoke-static {p1, v2}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result p1

    if-eqz p1, :cond_47

    const-string p1, "MessengerIpcClient"

    const-string v0, "Unbinding service"

    invoke-static {p1, v0}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    :cond_47
    iput v1, p0, Ll5/n;->r:I

    invoke-static {}, Lt5/a;->b()Lt5/a;

    move-result-object p1

    iget-object v0, p0, Ll5/n;->w:Ll5/t;

    .line 1
    iget-object v0, v0, Ll5/t;->a:Landroid/content/Context;

    .line 2
    invoke-virtual {p1, v0, p0}, Lt5/a;->c(Landroid/content/Context;Landroid/content/ServiceConnection;)V

    new-instance p1, Ll5/r;

    invoke-direct {p1, p2, p3}, Ll5/r;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    iget-object p2, p0, Ll5/n;->u:Ljava/util/Queue;

    invoke-interface {p2}, Ljava/util/Queue;->iterator()Ljava/util/Iterator;

    move-result-object p2

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

    move-result p3

    if-eqz p3, :cond_6f

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

    move-result-object p3

    check-cast p3, Ll5/q;

    invoke-virtual {p3, p1}, Ll5/q;->c(Ll5/r;)V

    goto :goto_5f

    :cond_6f
    iget-object p2, p0, Ll5/n;->u:Ljava/util/Queue;

    invoke-interface {p2}, Ljava/util/Queue;->clear()V

    const/4 p2, 0x0

    :goto_75
    iget-object p3, p0, Ll5/n;->v:Landroid/util/SparseArray;

    invoke-virtual {p3}, Landroid/util/SparseArray;->size()I

    move-result p3

    if-ge p2, p3, :cond_8b

    iget-object p3, p0, Ll5/n;->v:Landroid/util/SparseArray;

    invoke-virtual {p3, p2}, Landroid/util/SparseArray;->valueAt(I)Ljava/lang/Object;

    move-result-object p3

    check-cast p3, Ll5/q;

    invoke-virtual {p3, p1}, Ll5/q;->c(Ll5/r;)V

    add-int/lit8 p2, p2, 0x1

    goto :goto_75

    :cond_8b
    iget-object p1, p0, Ll5/n;->v:Landroid/util/SparseArray;

    invoke-virtual {p1}, Landroid/util/SparseArray;->clear()V
    :try_end_90
    .catchall {:try_start_38 .. :try_end_90} :catchall_98

    monitor-exit p0

    return-void

    :cond_92
    :try_start_92
    new-instance p1, Ljava/lang/IllegalStateException;

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

    throw p1
    :try_end_98
    .catchall {:try_start_92 .. :try_end_98} :catchall_98

    :catchall_98
    move-exception p1

    monitor-exit p0

    throw p1
.end method

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

    monitor-enter p0

    :try_start_1
    iget v0, p0, Ll5/n;->r:I

    const/4 v1, 0x2

    if-ne v0, v1, :cond_35

    iget-object v0, p0, Ll5/n;->u:Ljava/util/Queue;

    invoke-interface {v0}, Ljava/util/Queue;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_35

    iget-object v0, p0, Ll5/n;->v:Landroid/util/SparseArray;

    invoke-virtual {v0}, Landroid/util/SparseArray;->size()I

    move-result v0

    if-nez v0, :cond_35

    const-string v0, "MessengerIpcClient"

    invoke-static {v0, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result v0

    if-eqz v0, :cond_25

    const-string v0, "MessengerIpcClient"

    const-string v1, "Finished handling requests, unbinding"

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

    :cond_25
    const/4 v0, 0x3

    iput v0, p0, Ll5/n;->r:I

    invoke-static {}, Lt5/a;->b()Lt5/a;

    move-result-object v0

    iget-object v1, p0, Ll5/n;->w:Ll5/t;

    .line 1
    iget-object v1, v1, Ll5/t;->a:Landroid/content/Context;

    .line 2
    invoke-virtual {v0, v1, p0}, Lt5/a;->c(Landroid/content/Context;Landroid/content/ServiceConnection;)V
    :try_end_33
    .catchall {:try_start_1 .. :try_end_33} :catchall_37

    monitor-exit p0

    return-void

    :cond_35
    monitor-exit p0

    return-void

    :catchall_37
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public final declared-synchronized d(Ll5/q;)Z
    .registers 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ll5/q<",
            "*>;)Z"
        }
    .end annotation

    monitor-enter p0

    :try_start_1
    iget v0, p0, Ll5/n;->r:I
    :try_end_3
    .catchall {:try_start_1 .. :try_end_3} :catchall_81

    const/4 v1, 0x2

    const/4 v2, 0x0

    const/4 v3, 0x1

    if-eqz v0, :cond_28

    if-eq v0, v3, :cond_21

    if-eq v0, v1, :cond_e

    monitor-exit p0

    return v2

    :cond_e
    :try_start_e
    iget-object v0, p0, Ll5/n;->u:Ljava/util/Queue;

    invoke-interface {v0, p1}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z

    .line 1
    iget-object p1, p0, Ll5/n;->w:Ll5/t;

    .line 2
    iget-object p1, p1, Ll5/t;->b:Ljava/util/concurrent/ScheduledExecutorService;

    .line 3
    new-instance v0, Ll5/k;

    invoke-direct {v0, p0, v3}, Ll5/k;-><init>(Ll5/n;I)V

    invoke-interface {p1, v0}, Ljava/util/concurrent/ScheduledExecutorService;->execute(Ljava/lang/Runnable;)V
    :try_end_1f
    .catchall {:try_start_e .. :try_end_1f} :catchall_81

    .line 4
    monitor-exit p0

    return v3

    :cond_21
    :try_start_21
    iget-object v0, p0, Ll5/n;->u:Ljava/util/Queue;

    invoke-interface {v0, p1}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z
    :try_end_26
    .catchall {:try_start_21 .. :try_end_26} :catchall_81

    monitor-exit p0

    return v3

    :cond_28
    :try_start_28
    iget-object v0, p0, Ll5/n;->u:Ljava/util/Queue;

    invoke-interface {v0, p1}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z

    iget p1, p0, Ll5/n;->r:I

    if-nez p1, :cond_33

    move p1, v3

    goto :goto_34

    :cond_33
    move p1, v2

    :goto_34
    invoke-static {p1}, Lcom/google/android/gms/common/internal/d;->j(Z)V

    const-string p1, "MessengerIpcClient"

    invoke-static {p1, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result p1

    if-eqz p1, :cond_46

    const-string p1, "MessengerIpcClient"

    const-string v0, "Starting bind to GmsCore"

    invoke-static {p1, v0}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    :cond_46
    iput v3, p0, Ll5/n;->r:I

    new-instance p1, Landroid/content/Intent;

    const-string v0, "com.google.android.c2dm.intent.REGISTER"

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

    const-string v0, "com.google.android.gms"

    invoke-virtual {p1, v0}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;
    :try_end_54
    .catchall {:try_start_28 .. :try_end_54} :catchall_81

    :try_start_54
    invoke-static {}, Lt5/a;->b()Lt5/a;

    move-result-object v0

    iget-object v4, p0, Ll5/n;->w:Ll5/t;

    .line 5
    iget-object v4, v4, Ll5/t;->a:Landroid/content/Context;

    .line 6
    invoke-virtual {v0, v4, p1, p0, v3}, Lt5/a;->a(Landroid/content/Context;Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z

    move-result p1

    if-nez p1, :cond_68

    const-string p1, "Unable to bind to service"

    invoke-virtual {p0, v2, p1}, Ll5/n;->a(ILjava/lang/String;)V
    :try_end_67
    .catch Ljava/lang/SecurityException; {:try_start_54 .. :try_end_67} :catch_79
    .catchall {:try_start_54 .. :try_end_67} :catchall_81

    goto :goto_7f

    :cond_68
    :try_start_68
    iget-object p1, p0, Ll5/n;->w:Ll5/t;

    .line 7
    iget-object p1, p1, Ll5/t;->b:Ljava/util/concurrent/ScheduledExecutorService;

    .line 8
    new-instance v0, Ll5/k;

    invoke-direct {v0, p0, v1}, Ll5/k;-><init>(Ll5/n;I)V

    const-wide/16 v1, 0x1e

    sget-object v4, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;

    invoke-interface {p1, v0, v1, v2, v4}, Ljava/util/concurrent/ScheduledExecutorService;->schedule(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;

    goto :goto_7f

    :catch_79
    move-exception p1

    const-string v0, "Unable to bind to service"

    invoke-virtual {p0, v2, v0, p1}, Ll5/n;->b(ILjava/lang/String;Ljava/lang/Throwable;)V
    :try_end_7f
    .catchall {:try_start_68 .. :try_end_7f} :catchall_81

    :goto_7f
    monitor-exit p0

    return v3

    :catchall_81
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public final onServiceConnected(Landroid/content/ComponentName;Landroid/os/IBinder;)V
    .registers 4

    const-string p1, "MessengerIpcClient"

    const/4 v0, 0x2

    invoke-static {p1, v0}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result v0

    if-eqz v0, :cond_e

    const-string v0, "Service connected"

    invoke-static {p1, v0}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    :cond_e
    iget-object p1, p0, Ll5/n;->w:Ll5/t;

    .line 1
    iget-object p1, p1, Ll5/t;->b:Ljava/util/concurrent/ScheduledExecutorService;

    .line 2
    new-instance v0, Ll5/l;

    invoke-direct {v0, p0, p2}, Ll5/l;-><init>(Ll5/n;Landroid/os/IBinder;)V

    invoke-interface {p1, v0}, Ljava/util/concurrent/ScheduledExecutorService;->execute(Ljava/lang/Runnable;)V

    return-void
.end method

.method public final onServiceDisconnected(Landroid/content/ComponentName;)V
    .registers 4

    const-string p1, "MessengerIpcClient"

    const/4 v0, 0x2

    invoke-static {p1, v0}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result v0

    if-eqz v0, :cond_e

    const-string v0, "Service disconnected"

    invoke-static {p1, v0}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    :cond_e
    iget-object p1, p0, Ll5/n;->w:Ll5/t;

    .line 1
    iget-object p1, p1, Ll5/t;->b:Ljava/util/concurrent/ScheduledExecutorService;

    .line 2
    new-instance v0, Ll5/k;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Ll5/k;-><init>(Ll5/n;I)V

    invoke-interface {p1, v0}, Ljava/util/concurrent/ScheduledExecutorService;->execute(Ljava/lang/Runnable;)V

    return-void
.end method
