granularity level: instruction

		.class public final Lw/j;
.super Ljava/lang/Object;
.source "SourceFile"
.implements Landroid/content/ServiceConnection;


.field public a:I
.field public final b:Landroid/os/Messenger;
.field public c:Lk/j;
.field public final d:Ljava/util/ArrayDeque;
.field public final e:Landroid/util/SparseArray;
.field public final synthetic f:Lw/m;


.method public synthetic constructor <init>(Lw/m;)V
	.locals 3

	iput-object p1, p0, Lw/j;->f:Lw/m;
	invoke-direct {p0}, Ljava/lang/Object;-><init>()V
	const/4 p1, 0x0
	iput p1, p0, Lw/j;->a:I
	new-instance p1, Landroid/os/Messenger;
	new-instance v0, Lh0/d;
	invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;
	move-result-object v1
	new-instance v2, Lw/g;
	invoke-direct {v2, p0}, Lw/g;-><init>(Lw/j;)V
	invoke-direct {v0, v1, v2}, Lh0/d;-><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, Lw/j;->b:Landroid/os/Messenger;
	new-instance p1, Ljava/util/ArrayDeque;
	invoke-direct {p1}, Ljava/util/ArrayDeque;-><init>()V
	iput-object p1, p0, Lw/j;->d:Ljava/util/ArrayDeque;
	new-instance p1, Landroid/util/SparseArray;
	invoke-direct {p1}, Landroid/util/SparseArray;-><init>()V
	iput-object p1, p0, Lw/j;->e:Landroid/util/SparseArray;
	return-void
.end method

.method public final declared-synchronized a(ILjava/lang/String;)V
	.locals 1

	monitor-enter p0
	const/4 v0, 0x0
	:try_start_0
	invoke-virtual {p0, p1, p2, v0}, Lw/j;->b(ILjava/lang/String;Ljava/lang/SecurityException;)V
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_0
	monitor-exit p0
	return-void
	:catchall_0
	move-exception p1
	monitor-exit p0
	throw p1
.end method

.method public final declared-synchronized b(ILjava/lang/String;Ljava/lang/SecurityException;)V
	.locals 4

	monitor-enter p0
	:try_start_0
	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_1
	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_0
	invoke-virtual {v1, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
	move-result-object p1
	goto :goto_0
	:cond_0
	new-instance p1, Ljava/lang/String;
	invoke-direct {p1, v1}, Ljava/lang/String;-><init>(Ljava/lang/String;)V
	:goto_0
	const-string v1, "MessengerIpcClient"
	invoke-static {v1, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
	:cond_1
	iget p1, p0, Lw/j;->a:I
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_0
	if-eqz p1, :cond_7
	const/4 v1, 0x4
	const/4 v2, 0x2
	const/4 v3, 0x1
	if-eq p1, v3, :cond_3
	if-eq p1, v2, :cond_3
	if-eq p1, v0, :cond_2
	monitor-exit p0
	return-void
	:try_start_1
	:cond_2
	iput v1, p0, Lw/j;->a:I
	:try_end_1
	.catchall {:try_start_1 .. :try_end_1} :catchall_0
	monitor-exit p0
	return-void
	:try_start_2
	:cond_3
	const-string p1, "MessengerIpcClient"
	invoke-static {p1, v2}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
	move-result p1
	if-eqz p1, :cond_4
	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_4
	iput v1, p0, Lw/j;->a:I
	invoke-static {}, Ld0/a;->a()Ld0/a;
	move-result-object p1
	iget-object v0, p0, Lw/j;->f:Lw/m;
	iget-object v0, v0, Lw/m;->a:Landroid/content/Context;
	invoke-virtual {p1, v0, p0}, Ld0/a;->b(Landroid/content/Context;Landroid/content/ServiceConnection;)V
	new-instance p1, Lh1/y;
	invoke-direct {p1, p2, p3}, Lh1/y;-><init>(Ljava/lang/String;Ljava/lang/SecurityException;)V
	iget-object p2, p0, Lw/j;->d:Ljava/util/ArrayDeque;
	invoke-virtual {p2}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator;
	move-result-object p2
	:goto_1
	invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
	move-result p3
	if-eqz p3, :cond_5
	invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
	move-result-object p3
	check-cast p3, Lw/l;
	invoke-virtual {p3, p1}, Lw/l;->a(Lh1/y;)V
	goto :goto_1
	:cond_5
	iget-object p2, p0, Lw/j;->d:Ljava/util/ArrayDeque;
	invoke-virtual {p2}, Ljava/util/ArrayDeque;->clear()V
	const/4 p2, 0x0
	:goto_2
	iget-object p3, p0, Lw/j;->e:Landroid/util/SparseArray;
	invoke-virtual {p3}, Landroid/util/SparseArray;->size()I
	move-result p3
	if-ge p2, p3, :cond_6
	iget-object p3, p0, Lw/j;->e:Landroid/util/SparseArray;
	invoke-virtual {p3, p2}, Landroid/util/SparseArray;->valueAt(I)Ljava/lang/Object;
	move-result-object p3
	check-cast p3, Lw/l;
	invoke-virtual {p3, p1}, Lw/l;->a(Lh1/y;)V
	add-int/lit8 p2, p2, 0x1
	goto :goto_2
	:cond_6
	iget-object p1, p0, Lw/j;->e:Landroid/util/SparseArray;
	invoke-virtual {p1}, Landroid/util/SparseArray;->clear()V
	:try_end_2
	.catchall {:try_start_2 .. :try_end_2} :catchall_0
	monitor-exit p0
	return-void
	:try_start_3
	:cond_7
	new-instance p1, Ljava/lang/IllegalStateException;
	invoke-direct {p1}, Ljava/lang/IllegalStateException;-><init>()V
	throw p1
	:try_end_3
	.catchall {:try_start_3 .. :try_end_3} :catchall_0
	:catchall_0
	move-exception p1
	monitor-exit p0
	throw p1
.end method

.method public final declared-synchronized c()V
	.locals 2

	monitor-enter p0
	:try_start_0
	iget v0, p0, Lw/j;->a:I
	const/4 v1, 0x2
	if-ne v0, v1, :cond_1
	iget-object v0, p0, Lw/j;->d:Ljava/util/ArrayDeque;
	invoke-virtual {v0}, Ljava/util/ArrayDeque;->isEmpty()Z
	move-result v0
	if-eqz v0, :cond_1
	iget-object v0, p0, Lw/j;->e:Landroid/util/SparseArray;
	invoke-virtual {v0}, Landroid/util/SparseArray;->size()I
	move-result v0
	if-nez v0, :cond_1
	const-string v0, "MessengerIpcClient"
	invoke-static {v0, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
	move-result v0
	if-eqz v0, :cond_0
	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_0
	const/4 v0, 0x3
	iput v0, p0, Lw/j;->a:I
	invoke-static {}, Ld0/a;->a()Ld0/a;
	move-result-object v0
	iget-object v1, p0, Lw/j;->f:Lw/m;
	iget-object v1, v1, Lw/m;->a:Landroid/content/Context;
	invoke-virtual {v0, v1, p0}, Ld0/a;->b(Landroid/content/Context;Landroid/content/ServiceConnection;)V
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_0
	monitor-exit p0
	return-void
	:cond_1
	monitor-exit p0
	return-void
	:catchall_0
	move-exception v0
	monitor-exit p0
	throw v0
.end method

.method public final declared-synchronized d(Lw/k;)Z
	.locals 10

	monitor-enter p0
	:try_start_0
	iget v0, p0, Lw/j;->a:I
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_0
	const/4 v1, 0x2
	const/4 v2, 0x0
	const/4 v3, 0x1
	if-eqz v0, :cond_2
	if-eq v0, v3, :cond_1
	if-eq v0, v1, :cond_0
	monitor-exit p0
	return v2
	:try_start_1
	:cond_0
	iget-object v0, p0, Lw/j;->d:Ljava/util/ArrayDeque;
	invoke-virtual {v0, p1}, Ljava/util/ArrayDeque;->add(Ljava/lang/Object;)Z
	iget-object p1, p0, Lw/j;->f:Lw/m;
	iget-object p1, p1, Lw/m;->b:Ljava/util/concurrent/ScheduledExecutorService;
	new-instance v0, Lw/h;
	invoke-direct {v0, p0, v3}, Lw/h;-><init>(Lw/j;I)V
	invoke-interface {p1, v0}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
	:try_end_1
	.catchall {:try_start_1 .. :try_end_1} :catchall_0
	monitor-exit p0
	return v3
	:try_start_2
	:cond_1
	iget-object v0, p0, Lw/j;->d:Ljava/util/ArrayDeque;
	invoke-virtual {v0, p1}, Ljava/util/ArrayDeque;->add(Ljava/lang/Object;)Z
	:try_end_2
	.catchall {:try_start_2 .. :try_end_2} :catchall_0
	monitor-exit p0
	return v3
	:try_start_3
	:cond_2
	iget-object v0, p0, Lw/j;->d:Ljava/util/ArrayDeque;
	invoke-virtual {v0, p1}, Ljava/util/ArrayDeque;->add(Ljava/lang/Object;)Z
	iget p1, p0, Lw/j;->a:I
	if-nez p1, :cond_3
	const/4 p1, 0x1
	goto :goto_0
	:cond_3
	const/4 p1, 0x0
	:goto_0
	if-eqz p1, :cond_6
	const-string p1, "MessengerIpcClient"
	invoke-static {p1, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
	move-result p1
	if-eqz p1, :cond_4
	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_4
	iput v3, p0, Lw/j;->a:I
	new-instance v7, Landroid/content/Intent;
	const-string p1, "com.google.android.c2dm.intent.REGISTER"
	invoke-direct {v7, p1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
	const-string p1, "com.google.android.gms"
	invoke-virtual {v7, p1}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;
	:try_end_3
	.catchall {:try_start_3 .. :try_end_3} :catchall_0
	:try_start_4
	invoke-static {}, Ld0/a;->a()Ld0/a;
	move-result-object v4
	iget-object p1, p0, Lw/j;->f:Lw/m;
	iget-object v5, p1, Lw/m;->a:Landroid/content/Context;
	invoke-virtual {v5}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
	move-result-object p1
	invoke-virtual {p1}, Ljava/lang/Class;->getName()Ljava/lang/String;
	move-result-object v6
	const/4 v9, 0x1
	move-object v8, p0
	invoke-virtual/range {v4 .. v9}, Ld0/a;->c(Landroid/content/Context;Ljava/lang/String;Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z
	move-result p1
	if-nez p1, :cond_5
	const-string p1, "Unable to bind to service"
	invoke-virtual {p0, v2, p1}, Lw/j;->a(ILjava/lang/String;)V
	:try_end_4
	.catch Ljava/lang/SecurityException; {:try_start_4 .. :try_end_4} :catch_0
	.catchall {:try_start_4 .. :try_end_4} :catchall_0
	goto :goto_1
	:try_start_5
	:cond_5
	iget-object p1, p0, Lw/j;->f:Lw/m;
	iget-object p1, p1, Lw/m;->b:Ljava/util/concurrent/ScheduledExecutorService;
	new-instance v0, Lw/h;
	invoke-direct {v0, p0, v1}, Lw/h;-><init>(Lw/j;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_1
	:catch_0
	move-exception p1
	const-string v0, "Unable to bind to service"
	invoke-virtual {p0, v2, v0, p1}, Lw/j;->b(ILjava/lang/String;Ljava/lang/SecurityException;)V
	:try_end_5
	.catchall {:try_start_5 .. :try_end_5} :catchall_0
	:goto_1
	monitor-exit p0
	return v3
	:try_start_6
	:cond_6
	new-instance p1, Ljava/lang/IllegalStateException;
	invoke-direct {p1}, Ljava/lang/IllegalStateException;-><init>()V
	throw p1
	:try_end_6
	.catchall {:try_start_6 .. :try_end_6} :catchall_0
	:catchall_0
	move-exception p1
	monitor-exit p0
	throw p1
.end method

.method public final onServiceConnected(Landroid/content/ComponentName;Landroid/os/IBinder;)V
	.locals 2

	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_0
	const-string v0, "Service connected"
	invoke-static {p1, v0}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
	:cond_0
	iget-object p1, p0, Lw/j;->f:Lw/m;
	iget-object p1, p1, Lw/m;->b:Ljava/util/concurrent/ScheduledExecutorService;
	new-instance v0, Lw/i;
	const/4 v1, 0x0
	invoke-direct {v0, p0, p2, v1}, Lw/i;-><init>(Ljava/lang/Object;Ljava/lang/Object;I)V
	invoke-interface {p1, v0}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
	return-void
.end method

.method public final onServiceDisconnected(Landroid/content/ComponentName;)V
	.locals 2

	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_0
	const-string v0, "Service disconnected"
	invoke-static {p1, v0}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
	:cond_0
	iget-object p1, p0, Lw/j;->f:Lw/m;
	iget-object p1, p1, Lw/m;->b:Ljava/util/concurrent/ScheduledExecutorService;
	new-instance v0, Lw/h;
	const/4 v1, 0x0
	invoke-direct {v0, p0, v1}, Lw/h;-><init>(Lw/j;I)V
	invoke-interface {p1, v0}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
	return-void
.end method