granularity level: instruction

		.class public final Lh1/g0;
.super Ljava/lang/Object;
.source "SourceFile"


.field public static final i:J
.field public static final synthetic j:I
.field public final a:Landroid/content/Context;
.field public final b:Lh1/t;
.field public final c:Ll/h;
.field public final d:Lcom/google/firebase/messaging/FirebaseMessaging;
.field public final e:Lb/b;
.field public final f:Ljava/util/concurrent/ScheduledExecutorService;
.field public g:Z
.field public final h:Lh1/e0;


.method public static constructor <clinit>()V
	.locals 3

	sget-object v0, Ljava/util/concurrent/TimeUnit;->HOURS:Ljava/util/concurrent/TimeUnit;
	const-wide/16 v1, 0x8
	invoke-virtual {v0, v1, v2}, Ljava/util/concurrent/TimeUnit;->toSeconds(J)J
	move-result-wide v0
	sput-wide v0, Lh1/g0;->i:J
	return-void
.end method

.method public constructor <init>(Lcom/google/firebase/messaging/FirebaseMessaging;Lh1/t;Lh1/e0;Ll/h;Landroid/content/Context;Ljava/util/concurrent/ScheduledExecutorService;)V
	.locals 1

	invoke-direct {p0}, Ljava/lang/Object;-><init>()V
	new-instance v0, Lb/b;
	invoke-direct {v0}, Lb/b;-><init>()V
	iput-object v0, p0, Lh1/g0;->e:Lb/b;
	const/4 v0, 0x0
	iput-boolean v0, p0, Lh1/g0;->g:Z
	iput-object p1, p0, Lh1/g0;->d:Lcom/google/firebase/messaging/FirebaseMessaging;
	iput-object p2, p0, Lh1/g0;->b:Lh1/t;
	iput-object p3, p0, Lh1/g0;->h:Lh1/e0;
	iput-object p4, p0, Lh1/g0;->c:Ll/h;
	iput-object p5, p0, Lh1/g0;->a:Landroid/content/Context;
	iput-object p6, p0, Lh1/g0;->f:Ljava/util/concurrent/ScheduledExecutorService;
	return-void
.end method

.method public static a(Lo0/o;)V
	.locals 3

	:try_start_0
	sget-object v0, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
	const-wide/16 v1, 0x1e
	invoke-static {p0, v1, v2, v0}, Lf0/a;->b(Lo0/o;JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
	:try_end_0
	.catch Ljava/util/concurrent/ExecutionException; {:try_start_0 .. :try_end_0} :catch_2
	.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_1
	.catch Ljava/util/concurrent/TimeoutException; {:try_start_0 .. :try_end_0} :catch_0
	return-void
	:catch_0
	move-exception p0
	goto :goto_0
	:catch_1
	move-exception p0
	:goto_0
	new-instance v0, Ljava/io/IOException;
	const-string v1, "SERVICE_NOT_AVAILABLE"
	invoke-direct {v0, v1, p0}, Ljava/io/IOException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
	throw v0
	:catch_2
	move-exception p0
	invoke-virtual {p0}, Ljava/lang/Throwable;->getCause()Ljava/lang/Throwable;
	move-result-object v0
	instance-of v1, v0, Ljava/io/IOException;
	if-nez v1, :cond_1
	instance-of v1, v0, Ljava/lang/RuntimeException;
	if-eqz v1, :cond_0
	check-cast v0, Ljava/lang/RuntimeException;
	throw v0
	:cond_0
	new-instance v0, Ljava/io/IOException;
	invoke-direct {v0, p0}, Ljava/io/IOException;-><init>(Ljava/lang/Throwable;)V
	throw v0
	:cond_1
	check-cast v0, Ljava/io/IOException;
	throw v0
.end method

.method public static d()Z
	.locals 4

	const-string v0, "FirebaseMessaging"
	const/4 v1, 0x3
	invoke-static {v0, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
	move-result v2
	if-nez v2, :cond_1
	sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
	const/16 v3, 0x17
	if-ne v2, v3, :cond_0
	invoke-static {v0, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
	move-result v0
	if-eqz v0, :cond_0
	goto :goto_0
	:cond_0
	const/4 v0, 0x0
	goto :goto_1
	:cond_1
	:goto_0
	const/4 v0, 0x1
	:goto_1
	return v0
.end method

.method public final b(Ljava/lang/String;)V
	.locals 6

	iget-object v0, p0, Lh1/g0;->c:Ll/h;
	iget-object v1, p0, Lh1/g0;->d:Lcom/google/firebase/messaging/FirebaseMessaging;
	invoke-virtual {v1}, Lcom/google/firebase/messaging/FirebaseMessaging;->a()Ljava/lang/String;
	move-result-object v1
	invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
	new-instance v2, Landroid/os/Bundle;
	invoke-direct {v2}, Landroid/os/Bundle;-><init>()V
	new-instance v3, Ljava/lang/StringBuilder;
	invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
	const-string v4, "/topics/"
	invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object v3
	const-string v5, "gcm.topic"
	invoke-virtual {v2, v5, v3}, Landroid/os/BaseBundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
	new-instance v3, Ljava/lang/StringBuilder;
	invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
	invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object p1
	invoke-virtual {v0, v1, p1, v2}, Ll/h;->h(Ljava/lang/String;Ljava/lang/String;Landroid/os/Bundle;)Lo0/o;
	move-result-object p1
	invoke-virtual {v0, p1}, Ll/h;->c(Lo0/o;)Lo0/o;
	move-result-object p1
	invoke-static {p1}, Lh1/g0;->a(Lo0/o;)V
	return-void
.end method

.method public final c(Ljava/lang/String;)V
	.locals 6

	iget-object v0, p0, Lh1/g0;->c:Ll/h;
	iget-object v1, p0, Lh1/g0;->d:Lcom/google/firebase/messaging/FirebaseMessaging;
	invoke-virtual {v1}, Lcom/google/firebase/messaging/FirebaseMessaging;->a()Ljava/lang/String;
	move-result-object v1
	invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
	new-instance v2, Landroid/os/Bundle;
	invoke-direct {v2}, Landroid/os/Bundle;-><init>()V
	new-instance v3, Ljava/lang/StringBuilder;
	invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
	const-string v4, "/topics/"
	invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object v3
	const-string v5, "gcm.topic"
	invoke-virtual {v2, v5, v3}, Landroid/os/BaseBundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
	const-string v3, "delete"
	const-string v5, "1"
	invoke-virtual {v2, v3, v5}, Landroid/os/BaseBundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
	new-instance v3, Ljava/lang/StringBuilder;
	invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
	invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object p1
	invoke-virtual {v0, v1, p1, v2}, Ll/h;->h(Ljava/lang/String;Ljava/lang/String;Landroid/os/Bundle;)Lo0/o;
	move-result-object p1
	invoke-virtual {v0, p1}, Ll/h;->c(Lo0/o;)Lo0/o;
	move-result-object p1
	invoke-static {p1}, Lh1/g0;->a(Lo0/o;)V
	return-void
.end method

.method public final e()V
	.locals 2

	iget-object v0, p0, Lh1/g0;->h:Lh1/e0;
	invoke-virtual {v0}, Lh1/e0;->a()Lh1/d0;
	move-result-object v0
	if-eqz v0, :cond_0
	const/4 v0, 0x1
	goto :goto_0
	:cond_0
	const/4 v0, 0x0
	:goto_0
	if-eqz v0, :cond_1
	monitor-enter p0
	:try_start_0
	iget-boolean v0, p0, Lh1/g0;->g:Z
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_0
	monitor-exit p0
	if-nez v0, :cond_1
	const-wide/16 v0, 0x0
	invoke-virtual {p0, v0, v1}, Lh1/g0;->g(J)V
	goto :goto_1
	:catchall_0
	move-exception v0
	monitor-exit p0
	throw v0
	:goto_1
	:cond_1
	return-void
.end method

.method public final f()Z
	.locals 8

	:goto_0
	monitor-enter p0
	:try_start_0
	iget-object v0, p0, Lh1/g0;->h:Lh1/e0;
	invoke-virtual {v0}, Lh1/e0;->a()Lh1/d0;
	move-result-object v0
	const/4 v1, 0x1
	if-nez v0, :cond_1
	invoke-static {}, Lh1/g0;->d()Z
	move-result v0
	if-eqz v0, :cond_0
	const-string v0, "FirebaseMessaging"
	const-string v2, "topic sync succeeded"
	invoke-static {v0, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
	:cond_0
	monitor-exit p0
	return v1
	:cond_1
	monitor-exit p0
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_3
	const-string v2, "FirebaseMessaging"
	const/4 v3, 0x0
	:try_start_1
	iget-object v4, v0, Lh1/d0;->b:Ljava/lang/String;
	const/4 v5, -0x1
	invoke-virtual {v4}, Ljava/lang/String;->hashCode()I
	move-result v6
	const/16 v7, 0x53
	if-eq v6, v7, :cond_3
	const/16 v7, 0x55
	if-eq v6, v7, :cond_2
	goto :goto_1
	:cond_2
	const-string v6, "U"
	invoke-virtual {v4, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
	move-result v4
	if-eqz v4, :cond_4
	const/4 v5, 0x1
	goto :goto_1
	:cond_3
	const-string v6, "S"
	invoke-virtual {v4, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
	move-result v4
	:try_end_1
	.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
	if-eqz v4, :cond_4
	const/4 v5, 0x0
	:goto_1
	:cond_4
	const-string v4, " succeeded."
	if-eqz v5, :cond_6
	if-eq v5, v1, :cond_5
	:try_start_2
	invoke-static {}, Lh1/g0;->d()Z
	move-result v4
	if-eqz v4, :cond_a
	new-instance v4, Ljava/lang/StringBuilder;
	invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
	const-string v5, "Unknown topic operation"
	invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
	const-string v5, "."
	invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object v4
	goto :goto_4
	:cond_5
	iget-object v5, v0, Lh1/d0;->a:Ljava/lang/String;
	invoke-virtual {p0, v5}, Lh1/g0;->c(Ljava/lang/String;)V
	invoke-static {}, Lh1/g0;->d()Z
	move-result v5
	if-eqz v5, :cond_a
	new-instance v5, Ljava/lang/StringBuilder;
	invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
	const-string v6, "Unsubscribe from topic: "
	invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	iget-object v6, v0, Lh1/d0;->a:Ljava/lang/String;
	:goto_2
	invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	goto :goto_3
	:cond_6
	iget-object v5, v0, Lh1/d0;->a:Ljava/lang/String;
	invoke-virtual {p0, v5}, Lh1/g0;->b(Ljava/lang/String;)V
	invoke-static {}, Lh1/g0;->d()Z
	move-result v5
	if-eqz v5, :cond_a
	new-instance v5, Ljava/lang/StringBuilder;
	invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
	const-string v6, "Subscribe to topic: "
	invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	iget-object v6, v0, Lh1/d0;->a:Ljava/lang/String;
	goto :goto_2
	:goto_3
	invoke-virtual {v5, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object v4
	:goto_4
	invoke-static {v2, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
	:try_end_2
	.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0
	goto :goto_7
	:catch_0
	move-exception v1
	invoke-virtual {v1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
	move-result-object v4
	const-string v5, "SERVICE_NOT_AVAILABLE"
	invoke-virtual {v5, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
	move-result v4
	if-nez v4, :cond_9
	invoke-virtual {v1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
	move-result-object v4
	const-string v5, "INTERNAL_SERVER_ERROR"
	invoke-virtual {v5, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
	move-result v4
	if-eqz v4, :cond_7
	goto :goto_5
	:cond_7
	invoke-virtual {v1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
	move-result-object v4
	if-nez v4, :cond_8
	const-string v1, "Topic operation failed without exception message. Will retry Topic operation."
	goto :goto_6
	:cond_8
	throw v1
	:goto_5
	:cond_9
	const-string v4, "Topic operation failed: "
	invoke-static {v4}, Lc0/b;->b(Ljava/lang/String;)Ljava/lang/StringBuilder;
	move-result-object v4
	invoke-virtual {v1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
	move-result-object v1
	invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	const-string v1, ". Will retry Topic operation."
	invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object v1
	:goto_6
	invoke-static {v2, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
	const/4 v1, 0x0
	:goto_7
	:cond_a
	if-nez v1, :cond_b
	return v3
	:cond_b
	iget-object v1, p0, Lh1/g0;->h:Lh1/e0;
	monitor-enter v1
	:try_start_3
	iget-object v2, v1, Lh1/e0;->a:Lz/s;
	iget-object v3, v0, Lh1/d0;->c:Ljava/lang/String;
	iget-object v4, v2, Lz/s;->e:Ljava/util/Collection;
	check-cast v4, Ljava/util/ArrayDeque;
	monitor-enter v4
	:try_end_3
	.catchall {:try_start_3 .. :try_end_3} :catchall_2
	:try_start_4
	iget-object v5, v2, Lz/s;->e:Ljava/util/Collection;
	check-cast v5, Ljava/util/ArrayDeque;
	invoke-virtual {v5, v3}, Ljava/util/ArrayDeque;->remove(Ljava/lang/Object;)Z
	move-result v3
	if-eqz v3, :cond_c
	iget-boolean v3, v2, Lz/s;->a:Z
	if-nez v3, :cond_c
	iget-object v3, v2, Lz/s;->f:Ljava/lang/Object;
	check-cast v3, Ljava/util/concurrent/Executor;
	new-instance v5, Lq/n;
	const/4 v6, 0x2
	invoke-direct {v5, v6, v2}, Lq/n;-><init>(ILjava/lang/Object;)V
	invoke-interface {v3, v5}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
	:cond_c
	monitor-exit v4
	:try_end_4
	.catchall {:try_start_4 .. :try_end_4} :catchall_1
	monitor-exit v1
	iget-object v2, p0, Lh1/g0;->e:Lb/b;
	monitor-enter v2
	:try_start_5
	iget-object v0, v0, Lh1/d0;->c:Ljava/lang/String;
	iget-object v1, p0, Lh1/g0;->e:Lb/b;
	invoke-virtual {v1, v0}, Lb/i;->containsKey(Ljava/lang/Object;)Z
	move-result v1
	if-nez v1, :cond_d
	goto :goto_8
	:cond_d
	iget-object v1, p0, Lh1/g0;->e:Lb/b;
	invoke-virtual {v1, v0}, Lb/i;->get(Ljava/lang/Object;)Ljava/lang/Object;
	move-result-object v1
	check-cast v1, Ljava/util/ArrayDeque;
	invoke-virtual {v1}, Ljava/util/ArrayDeque;->poll()Ljava/lang/Object;
	move-result-object v3
	check-cast v3, Lo0/i;
	if-eqz v3, :cond_e
	const/4 v4, 0x0
	invoke-virtual {v3, v4}, Lo0/i;->a(Ljava/lang/Object;)V
	:cond_e
	invoke-virtual {v1}, Ljava/util/ArrayDeque;->isEmpty()Z
	move-result v1
	if-eqz v1, :cond_f
	iget-object v1, p0, Lh1/g0;->e:Lb/b;
	invoke-virtual {v1, v0}, Lb/i;->remove(Ljava/lang/Object;)Ljava/lang/Object;
	:goto_8
	:cond_f
	monitor-exit v2
	goto/16 :goto_0
	:catchall_0
	move-exception v0
	monitor-exit v2
	:try_end_5
	.catchall {:try_start_5 .. :try_end_5} :catchall_0
	throw v0
	:catchall_1
	move-exception v0
	:try_start_6
	monitor-exit v4
	:try_end_6
	.catchall {:try_start_6 .. :try_end_6} :catchall_1
	:try_start_7
	throw v0
	:try_end_7
	.catchall {:try_start_7 .. :try_end_7} :catchall_2
	:catchall_2
	move-exception v0
	monitor-exit v1
	throw v0
	:catchall_3
	move-exception v0
	:try_start_8
	monitor-exit p0
	:try_end_8
	.catchall {:try_start_8 .. :try_end_8} :catchall_3
	throw v0
.end method

.method public final g(J)V
	.locals 10

	const-wide/16 v0, 0x2
	mul-long v0, v0, p1
	const-wide/16 v2, 0x1e
	invoke-static {v2, v3, v0, v1}, Ljava/lang/Math;->max(JJ)J
	move-result-wide v0
	sget-wide v2, Lh1/g0;->i:J
	invoke-static {v0, v1, v2, v3}, Ljava/lang/Math;->min(JJ)J
	move-result-wide v8
	new-instance v0, Lh1/i0;
	iget-object v6, p0, Lh1/g0;->a:Landroid/content/Context;
	iget-object v7, p0, Lh1/g0;->b:Lh1/t;
	move-object v4, v0
	move-object v5, p0
	invoke-direct/range {v4 .. v9}, Lh1/i0;-><init>(Lh1/g0;Landroid/content/Context;Lh1/t;J)V
	iget-object v1, p0, Lh1/g0;->f:Ljava/util/concurrent/ScheduledExecutorService;
	sget-object v2, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
	invoke-interface {v1, v0, p1, p2, v2}, Ljava/util/concurrent/ScheduledExecutorService;->schedule(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
	const/4 p1, 0x1
	monitor-enter p0
	:try_start_0
	iput-boolean p1, p0, Lh1/g0;->g:Z
	: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