granularity level: instruction

		.class public final Lh1/c0;
.super Ljava/lang/Object;
.source "SourceFile"
.implements Ljava/lang/Runnable;


.field public final a:J
.field public final b:Landroid/os/PowerManager$WakeLock;
.field public final c:Lcom/google/firebase/messaging/FirebaseMessaging;


.method public constructor <init>(Lcom/google/firebase/messaging/FirebaseMessaging;J)V
	.locals 8

	invoke-direct {p0}, Ljava/lang/Object;-><init>()V
	new-instance v0, Ljava/util/concurrent/ThreadPoolExecutor;
	sget-object v5, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
	new-instance v6, Ljava/util/concurrent/LinkedBlockingQueue;
	invoke-direct {v6}, Ljava/util/concurrent/LinkedBlockingQueue;-><init>()V
	new-instance v7, La/b;
	const-string v1, "firebase-iid-executor"
	invoke-direct {v7, v1}, La/b;-><init>(Ljava/lang/String;)V
	const/4 v1, 0x0
	const/4 v2, 0x1
	const-wide/16 v3, 0x1e
	invoke-direct/range {v0 .. v7}, Ljava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;)V
	iput-object p1, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	iput-wide p2, p0, Lh1/c0;->a:J
	iget-object p1, p1, Lcom/google/firebase/messaging/FirebaseMessaging;->b:Landroid/content/Context;
	const-string p2, "power"
	invoke-virtual {p1, p2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
	move-result-object p1
	check-cast p1, Landroid/os/PowerManager;
	const/4 p2, 0x1
	const-string p3, "fiid-sync"
	invoke-virtual {p1, p2, p3}, Landroid/os/PowerManager;->newWakeLock(ILjava/lang/String;)Landroid/os/PowerManager$WakeLock;
	move-result-object p1
	iput-object p1, p0, Lh1/c0;->b:Landroid/os/PowerManager$WakeLock;
	const/4 p2, 0x0
	invoke-virtual {p1, p2}, Landroid/os/PowerManager$WakeLock;->setReferenceCounted(Z)V
	return-void
.end method

.method public final a()Z
	.locals 2

	iget-object v0, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	iget-object v0, v0, Lcom/google/firebase/messaging/FirebaseMessaging;->b:Landroid/content/Context;
	const-string v1, "connectivity"
	invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
	move-result-object v0
	check-cast v0, Landroid/net/ConnectivityManager;
	if-eqz v0, :cond_0
	invoke-virtual {v0}, Landroid/net/ConnectivityManager;->getActiveNetworkInfo()Landroid/net/NetworkInfo;
	move-result-object v0
	goto :goto_0
	:cond_0
	const/4 v0, 0x0
	:goto_0
	if-eqz v0, :cond_1
	invoke-virtual {v0}, Landroid/net/NetworkInfo;->isConnected()Z
	move-result v0
	if-eqz v0, :cond_1
	const/4 v0, 0x1
	goto :goto_1
	:cond_1
	const/4 v0, 0x0
	:goto_1
	return v0
.end method

.method public final b()Z
	.locals 6

	const-string v0, "FirebaseMessaging"
	const/4 v1, 0x1
	const/4 v2, 0x0
	:try_start_0
	iget-object v3, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	invoke-virtual {v3}, Lcom/google/firebase/messaging/FirebaseMessaging;->a()Ljava/lang/String;
	move-result-object v3
	if-nez v3, :cond_0
	const-string v3, "Token retrieval failed: null"
	invoke-static {v0, v3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
	return v2
	:cond_0
	const/4 v3, 0x3
	invoke-static {v0, v3}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
	move-result v3
	if-eqz v3, :cond_1
	const-string v3, "Token successfully retrieved"
	invoke-static {v0, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
	:try_end_0
	.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
	.catch Ljava/lang/SecurityException; {:try_start_0 .. :try_end_0} :catch_0
	:cond_1
	return v1
	:catch_0
	const-string v1, "Token retrieval failed with SecurityException. Will retry token retrieval"
	goto :goto_1
	:catch_1
	move-exception v3
	invoke-virtual {v3}, 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 v5
	if-nez v5, :cond_3
	const-string v5, "INTERNAL_SERVER_ERROR"
	invoke-virtual {v5, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
	move-result v5
	if-nez v5, :cond_3
	const-string v5, "InternalServerError"
	invoke-virtual {v5, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
	move-result v4
	if-eqz v4, :cond_2
	goto :goto_0
	:cond_2
	const/4 v1, 0x0
	:goto_0
	:cond_3
	if-eqz v1, :cond_4
	const-string v1, "Token retrieval failed: "
	invoke-static {v1}, Lc0/b;->b(Ljava/lang/String;)Ljava/lang/StringBuilder;
	move-result-object v1
	invoke-virtual {v3}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
	move-result-object v3
	invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	const-string v3, ". Will retry token retrieval"
	invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object v1
	goto :goto_1
	:cond_4
	invoke-virtual {v3}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
	move-result-object v1
	if-nez v1, :cond_5
	const-string v1, "Token retrieval failed without exception message. Will retry token retrieval"
	:goto_1
	invoke-static {v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
	return v2
	:cond_5
	throw v3
.end method

.method public final run()V
	.locals 5

	invoke-static {}, Lh1/z;->a()Lh1/z;
	move-result-object v0
	iget-object v1, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	iget-object v1, v1, Lcom/google/firebase/messaging/FirebaseMessaging;->b:Landroid/content/Context;
	invoke-virtual {v0, v1}, Lh1/z;->c(Landroid/content/Context;)Z
	move-result v0
	if-eqz v0, :cond_0
	iget-object v0, p0, Lh1/c0;->b:Landroid/os/PowerManager$WakeLock;
	invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->acquire()V
	:cond_0
	const/4 v0, 0x0
	:try_start_0
	iget-object v1, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	const/4 v2, 0x1
	monitor-enter v1
	:try_end_0
	.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_1
	:try_start_1
	iput-boolean v2, v1, Lcom/google/firebase/messaging/FirebaseMessaging;->i:Z
	:try_end_1
	.catchall {:try_start_1 .. :try_end_1} :catchall_3
	:try_start_2
	monitor-exit v1
	iget-object v1, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	iget-object v1, v1, Lcom/google/firebase/messaging/FirebaseMessaging;->h:Lh1/t;
	invoke-virtual {v1}, Lh1/t;->c()Z
	move-result v1
	if-nez v1, :cond_2
	iget-object v1, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	monitor-enter v1
	:try_end_2
	.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0
	.catchall {:try_start_2 .. :try_end_2} :catchall_1
	:try_start_3
	iput-boolean v0, v1, Lcom/google/firebase/messaging/FirebaseMessaging;->i:Z
	:try_end_3
	.catchall {:try_start_3 .. :try_end_3} :catchall_0
	:try_start_4
	monitor-exit v1
	:try_end_4
	.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_0
	.catchall {:try_start_4 .. :try_end_4} :catchall_1
	invoke-static {}, Lh1/z;->a()Lh1/z;
	move-result-object v0
	iget-object v1, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	iget-object v1, v1, Lcom/google/firebase/messaging/FirebaseMessaging;->b:Landroid/content/Context;
	invoke-virtual {v0, v1}, Lh1/z;->c(Landroid/content/Context;)Z
	move-result v0
	if-eqz v0, :cond_1
	iget-object v0, p0, Lh1/c0;->b:Landroid/os/PowerManager$WakeLock;
	invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->release()V
	:cond_1
	return-void
	:catchall_0
	move-exception v2
	:try_start_5
	monitor-exit v1
	throw v2
	:catchall_1
	move-exception v0
	goto/16 :goto_3
	:catch_0
	move-exception v1
	goto :goto_1
	:cond_2
	invoke-static {}, Lh1/z;->a()Lh1/z;
	move-result-object v1
	iget-object v2, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	iget-object v2, v2, Lcom/google/firebase/messaging/FirebaseMessaging;->b:Landroid/content/Context;
	invoke-virtual {v1, v2}, Lh1/z;->b(Landroid/content/Context;)Z
	move-result v1
	if-eqz v1, :cond_4
	invoke-virtual {p0}, Lh1/c0;->a()Z
	move-result v1
	if-nez v1, :cond_4
	new-instance v1, Lh1/b0;
	invoke-direct {v1, p0}, Lh1/b0;-><init>(Lh1/c0;)V
	invoke-virtual {v1}, Lh1/b0;->a()V
	:try_end_5
	.catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_0
	.catchall {:try_start_5 .. :try_end_5} :catchall_1
	invoke-static {}, Lh1/z;->a()Lh1/z;
	move-result-object v0
	iget-object v1, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	iget-object v1, v1, Lcom/google/firebase/messaging/FirebaseMessaging;->b:Landroid/content/Context;
	invoke-virtual {v0, v1}, Lh1/z;->c(Landroid/content/Context;)Z
	move-result v0
	if-eqz v0, :cond_3
	iget-object v0, p0, Lh1/c0;->b:Landroid/os/PowerManager$WakeLock;
	invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->release()V
	:cond_3
	return-void
	:try_start_6
	:cond_4
	invoke-virtual {p0}, Lh1/c0;->b()Z
	move-result v1
	if-eqz v1, :cond_5
	iget-object v1, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	monitor-enter v1
	:try_end_6
	.catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_0
	.catchall {:try_start_6 .. :try_end_6} :catchall_1
	:try_start_7
	iput-boolean v0, v1, Lcom/google/firebase/messaging/FirebaseMessaging;->i:Z
	:try_end_7
	.catchall {:try_start_7 .. :try_end_7} :catchall_2
	:try_start_8
	monitor-exit v1
	goto :goto_0
	:catchall_2
	move-exception v2
	monitor-exit v1
	throw v2
	:cond_5
	iget-object v1, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	iget-wide v2, p0, Lh1/c0;->a:J
	invoke-virtual {v1, v2, v3}, Lcom/google/firebase/messaging/FirebaseMessaging;->d(J)V
	:try_end_8
	.catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_0
	.catchall {:try_start_8 .. :try_end_8} :catchall_1
	:goto_0
	invoke-static {}, Lh1/z;->a()Lh1/z;
	move-result-object v0
	iget-object v1, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	iget-object v1, v1, Lcom/google/firebase/messaging/FirebaseMessaging;->b:Landroid/content/Context;
	invoke-virtual {v0, v1}, Lh1/z;->c(Landroid/content/Context;)Z
	move-result v0
	if-eqz v0, :cond_6
	goto :goto_2
	:catchall_3
	move-exception v2
	:try_start_9
	monitor-exit v1
	throw v2
	:try_end_9
	.catch Ljava/io/IOException; {:try_start_9 .. :try_end_9} :catch_0
	.catchall {:try_start_9 .. :try_end_9} :catchall_1
	:goto_1
	:try_start_a
	const-string v2, "FirebaseMessaging"
	new-instance v3, Ljava/lang/StringBuilder;
	invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
	const-string v4, "Topic sync or token retrieval failed on hard failure exceptions: "
	invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
	move-result-object v1
	invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	const-string v1, ". Won\'t retry the operation."
	invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object v1
	invoke-static {v2, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
	iget-object v1, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	monitor-enter v1
	:try_end_a
	.catchall {:try_start_a .. :try_end_a} :catchall_1
	:try_start_b
	iput-boolean v0, v1, Lcom/google/firebase/messaging/FirebaseMessaging;->i:Z
	:try_end_b
	.catchall {:try_start_b .. :try_end_b} :catchall_4
	:try_start_c
	monitor-exit v1
	:try_end_c
	.catchall {:try_start_c .. :try_end_c} :catchall_1
	invoke-static {}, Lh1/z;->a()Lh1/z;
	move-result-object v0
	iget-object v1, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	iget-object v1, v1, Lcom/google/firebase/messaging/FirebaseMessaging;->b:Landroid/content/Context;
	invoke-virtual {v0, v1}, Lh1/z;->c(Landroid/content/Context;)Z
	move-result v0
	if-eqz v0, :cond_6
	:goto_2
	iget-object v0, p0, Lh1/c0;->b:Landroid/os/PowerManager$WakeLock;
	invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->release()V
	:cond_6
	return-void
	:catchall_4
	move-exception v0
	:try_start_d
	monitor-exit v1
	throw v0
	:try_end_d
	.catchall {:try_start_d .. :try_end_d} :catchall_1
	:goto_3
	invoke-static {}, Lh1/z;->a()Lh1/z;
	move-result-object v1
	iget-object v2, p0, Lh1/c0;->c:Lcom/google/firebase/messaging/FirebaseMessaging;
	iget-object v2, v2, Lcom/google/firebase/messaging/FirebaseMessaging;->b:Landroid/content/Context;
	invoke-virtual {v1, v2}, Lh1/z;->c(Landroid/content/Context;)Z
	move-result v1
	if-eqz v1, :cond_7
	iget-object v1, p0, Lh1/c0;->b:Landroid/os/PowerManager$WakeLock;
	invoke-virtual {v1}, Landroid/os/PowerManager$WakeLock;->release()V
	:cond_7
	throw v0
.end method