granularity level: instruction

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


.field public static final f:Ljava/lang/Object;
.field public static g:Ljava/lang/Boolean;
.field public static h:Ljava/lang/Boolean;
.field public final a:Landroid/content/Context;
.field public final b:Lh1/t;
.field public final c:Landroid/os/PowerManager$WakeLock;
.field public final d:Lh1/g0;
.field public final e:J


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

	new-instance v0, Ljava/lang/Object;
	invoke-direct {v0}, Ljava/lang/Object;-><init>()V
	sput-object v0, Lh1/i0;->f:Ljava/lang/Object;
	return-void
.end method

.method public constructor <init>(Lh1/g0;Landroid/content/Context;Lh1/t;J)V
	.locals 0

	invoke-direct {p0}, Ljava/lang/Object;-><init>()V
	iput-object p1, p0, Lh1/i0;->d:Lh1/g0;
	iput-object p2, p0, Lh1/i0;->a:Landroid/content/Context;
	iput-wide p4, p0, Lh1/i0;->e:J
	iput-object p3, p0, Lh1/i0;->b:Lh1/t;
	const-string p1, "power"
	invoke-virtual {p2, p1}, 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, "wake:com.google.firebase.messaging"
	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/i0;->c:Landroid/os/PowerManager$WakeLock;
	return-void
.end method

.method public static a(Landroid/content/Context;)Z
	.locals 3

	sget-object v0, Lh1/i0;->f:Ljava/lang/Object;
	monitor-enter v0
	:try_start_0
	sget-object v1, Lh1/i0;->h:Ljava/lang/Boolean;
	if-nez v1, :cond_0
	const-string v2, "android.permission.ACCESS_NETWORK_STATE"
	invoke-static {p0, v2, v1}, Lh1/i0;->b(Landroid/content/Context;Ljava/lang/String;Ljava/lang/Boolean;)Z
	move-result p0
	goto :goto_0
	:cond_0
	invoke-virtual {v1}, Ljava/lang/Boolean;->booleanValue()Z
	move-result p0
	:goto_0
	invoke-static {p0}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
	move-result-object p0
	sput-object p0, Lh1/i0;->h:Ljava/lang/Boolean;
	invoke-virtual {p0}, Ljava/lang/Boolean;->booleanValue()Z
	move-result p0
	monitor-exit v0
	return p0
	:catchall_0
	move-exception p0
	monitor-exit v0
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_0
	throw p0
.end method

.method public static b(Landroid/content/Context;Ljava/lang/String;Ljava/lang/Boolean;)Z
	.locals 2

	if-eqz p2, :cond_0
	invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z
	move-result p0
	return p0
	:cond_0
	invoke-virtual {p0, p1}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I
	move-result p0
	if-nez p0, :cond_1
	const/4 p0, 0x1
	goto :goto_0
	:cond_1
	const/4 p0, 0x0
	:goto_0
	if-nez p0, :cond_2
	const/4 p2, 0x3
	const-string v0, "FirebaseMessaging"
	invoke-static {v0, p2}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
	move-result p2
	if-eqz p2, :cond_2
	new-instance p2, Ljava/lang/StringBuilder;
	invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
	const-string v1, "Missing Permission: "
	invoke-virtual {p2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	const-string p1, ". This permission should normally be included by the manifest merger, but may needed to be manually added to your manifest"
	invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object p1
	invoke-static {v0, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
	:cond_2
	return p0
.end method

.method public static c(Landroid/content/Context;)Z
	.locals 3

	sget-object v0, Lh1/i0;->f:Ljava/lang/Object;
	monitor-enter v0
	:try_start_0
	sget-object v1, Lh1/i0;->g:Ljava/lang/Boolean;
	if-nez v1, :cond_0
	const-string v2, "android.permission.WAKE_LOCK"
	invoke-static {p0, v2, v1}, Lh1/i0;->b(Landroid/content/Context;Ljava/lang/String;Ljava/lang/Boolean;)Z
	move-result p0
	goto :goto_0
	:cond_0
	invoke-virtual {v1}, Ljava/lang/Boolean;->booleanValue()Z
	move-result p0
	:goto_0
	invoke-static {p0}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
	move-result-object p0
	sput-object p0, Lh1/i0;->g:Ljava/lang/Boolean;
	invoke-virtual {p0}, Ljava/lang/Boolean;->booleanValue()Z
	move-result p0
	monitor-exit v0
	return p0
	:catchall_0
	move-exception p0
	monitor-exit v0
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_0
	throw p0
.end method

.method public final declared-synchronized d()Z
	.locals 2

	monitor-enter p0
	:try_start_0
	iget-object v0, p0, Lh1/i0;->a: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
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_0
	if-eqz v0, :cond_1
	const/4 v0, 0x1
	goto :goto_1
	:cond_1
	const/4 v0, 0x0
	:goto_1
	monitor-exit p0
	return v0
	:catchall_0
	move-exception v0
	monitor-exit p0
	throw v0
.end method

.method public final run()V
	.locals 6

	const-string v0, "TopicsSyncTask\'s wakelock was already released due to timeout."
	const-string v1, "FirebaseMessaging"
	iget-object v2, p0, Lh1/i0;->a:Landroid/content/Context;
	invoke-static {v2}, Lh1/i0;->c(Landroid/content/Context;)Z
	move-result v2
	if-eqz v2, :cond_0
	iget-object v2, p0, Lh1/i0;->c:Landroid/os/PowerManager$WakeLock;
	sget-wide v3, Lh1/g;->a:J
	invoke-virtual {v2, v3, v4}, Landroid/os/PowerManager$WakeLock;->acquire(J)V
	:cond_0
	const/4 v2, 0x0
	:try_start_0
	iget-object v3, p0, Lh1/i0;->d:Lh1/g0;
	const/4 v4, 0x1
	monitor-enter v3
	:try_end_0
	.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
	.catchall {:try_start_0 .. :try_end_0} :catchall_1
	:try_start_1
	iput-boolean v4, v3, Lh1/g0;->g:Z
	:try_end_1
	.catchall {:try_start_1 .. :try_end_1} :catchall_3
	:try_start_2
	monitor-exit v3
	iget-object v3, p0, Lh1/i0;->b:Lh1/t;
	invoke-virtual {v3}, Lh1/t;->c()Z
	move-result v3
	if-nez v3, :cond_2
	iget-object v3, p0, Lh1/i0;->d:Lh1/g0;
	monitor-enter v3
	:try_end_2
	.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_1
	.catchall {:try_start_2 .. :try_end_2} :catchall_1
	:try_start_3
	iput-boolean v2, v3, Lh1/g0;->g:Z
	:try_end_3
	.catchall {:try_start_3 .. :try_end_3} :catchall_0
	:try_start_4
	monitor-exit v3
	:try_end_4
	.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_1
	.catchall {:try_start_4 .. :try_end_4} :catchall_1
	iget-object v2, p0, Lh1/i0;->a:Landroid/content/Context;
	invoke-static {v2}, Lh1/i0;->c(Landroid/content/Context;)Z
	move-result v2
	if-eqz v2, :cond_1
	:try_start_5
	iget-object v2, p0, Lh1/i0;->c:Landroid/os/PowerManager$WakeLock;
	invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
	:try_end_5
	.catch Ljava/lang/RuntimeException; {:try_start_5 .. :try_end_5} :catch_0
	goto :goto_0
	:catch_0
	invoke-static {v1, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
	:goto_0
	:cond_1
	return-void
	:catchall_0
	move-exception v4
	:try_start_6
	monitor-exit v3
	throw v4
	:catchall_1
	move-exception v2
	goto/16 :goto_7
	:catch_1
	move-exception v3
	goto :goto_4
	:cond_2
	iget-object v3, p0, Lh1/i0;->a:Landroid/content/Context;
	invoke-static {v3}, Lh1/i0;->a(Landroid/content/Context;)Z
	move-result v3
	if-eqz v3, :cond_4
	invoke-virtual {p0}, Lh1/i0;->d()Z
	move-result v3
	if-nez v3, :cond_4
	new-instance v3, Lh1/h0;
	invoke-direct {v3, p0, p0}, Lh1/h0;-><init>(Lh1/i0;Lh1/i0;)V
	invoke-virtual {v3}, Lh1/h0;->a()V
	:try_end_6
	.catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_1
	.catchall {:try_start_6 .. :try_end_6} :catchall_1
	iget-object v2, p0, Lh1/i0;->a:Landroid/content/Context;
	invoke-static {v2}, Lh1/i0;->c(Landroid/content/Context;)Z
	move-result v2
	if-eqz v2, :cond_3
	:try_start_7
	iget-object v2, p0, Lh1/i0;->c:Landroid/os/PowerManager$WakeLock;
	invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
	:try_end_7
	.catch Ljava/lang/RuntimeException; {:try_start_7 .. :try_end_7} :catch_2
	goto :goto_1
	:catch_2
	invoke-static {v1, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
	:goto_1
	:cond_3
	return-void
	:cond_4
	:try_start_8
	iget-object v3, p0, Lh1/i0;->d:Lh1/g0;
	invoke-virtual {v3}, Lh1/g0;->f()Z
	move-result v3
	if-eqz v3, :cond_5
	iget-object v3, p0, Lh1/i0;->d:Lh1/g0;
	monitor-enter v3
	:try_end_8
	.catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_1
	.catchall {:try_start_8 .. :try_end_8} :catchall_1
	:try_start_9
	iput-boolean v2, v3, Lh1/g0;->g:Z
	:try_end_9
	.catchall {:try_start_9 .. :try_end_9} :catchall_2
	:try_start_a
	monitor-exit v3
	goto :goto_2
	:catchall_2
	move-exception v4
	monitor-exit v3
	throw v4
	:cond_5
	iget-object v3, p0, Lh1/i0;->d:Lh1/g0;
	iget-wide v4, p0, Lh1/i0;->e:J
	invoke-virtual {v3, v4, v5}, Lh1/g0;->g(J)V
	:try_end_a
	.catch Ljava/io/IOException; {:try_start_a .. :try_end_a} :catch_1
	.catchall {:try_start_a .. :try_end_a} :catchall_1
	:goto_2
	iget-object v2, p0, Lh1/i0;->a:Landroid/content/Context;
	invoke-static {v2}, Lh1/i0;->c(Landroid/content/Context;)Z
	move-result v2
	if-eqz v2, :cond_6
	:goto_3
	:try_start_b
	iget-object v2, p0, Lh1/i0;->c:Landroid/os/PowerManager$WakeLock;
	:try_end_b
	.catch Ljava/lang/RuntimeException; {:try_start_b .. :try_end_b} :catch_3
	goto :goto_5
	:catchall_3
	move-exception v4
	:try_start_c
	monitor-exit v3
	throw v4
	:try_end_c
	.catch Ljava/io/IOException; {:try_start_c .. :try_end_c} :catch_1
	.catchall {:try_start_c .. :try_end_c} :catchall_1
	:goto_4
	:try_start_d
	new-instance v4, Ljava/lang/StringBuilder;
	invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
	const-string v5, "Failed to sync topics. Won\'t retry sync. "
	invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v3}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
	move-result-object v3
	invoke-virtual {v4, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
	invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
	move-result-object v3
	invoke-static {v1, v3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
	iget-object v3, p0, Lh1/i0;->d:Lh1/g0;
	monitor-enter v3
	:try_end_d
	.catchall {:try_start_d .. :try_end_d} :catchall_1
	:try_start_e
	iput-boolean v2, v3, Lh1/g0;->g:Z
	:try_end_e
	.catchall {:try_start_e .. :try_end_e} :catchall_4
	:try_start_f
	monitor-exit v3
	:try_end_f
	.catchall {:try_start_f .. :try_end_f} :catchall_1
	iget-object v2, p0, Lh1/i0;->a:Landroid/content/Context;
	invoke-static {v2}, Lh1/i0;->c(Landroid/content/Context;)Z
	move-result v2
	if-eqz v2, :cond_6
	goto :goto_3
	:try_start_10
	:goto_5
	invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
	:try_end_10
	.catch Ljava/lang/RuntimeException; {:try_start_10 .. :try_end_10} :catch_3
	goto :goto_6
	:catch_3
	invoke-static {v1, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
	:goto_6
	:cond_6
	return-void
	:catchall_4
	move-exception v2
	:try_start_11
	monitor-exit v3
	throw v2
	:try_end_11
	.catchall {:try_start_11 .. :try_end_11} :catchall_1
	:goto_7
	iget-object v3, p0, Lh1/i0;->a:Landroid/content/Context;
	invoke-static {v3}, Lh1/i0;->c(Landroid/content/Context;)Z
	move-result v3
	if-eqz v3, :cond_7
	:try_start_12
	iget-object v3, p0, Lh1/i0;->c:Landroid/os/PowerManager$WakeLock;
	invoke-virtual {v3}, Landroid/os/PowerManager$WakeLock;->release()V
	:try_end_12
	.catch Ljava/lang/RuntimeException; {:try_start_12 .. :try_end_12} :catch_4
	goto :goto_8
	:catch_4
	invoke-static {v1, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
	:goto_8
	:cond_7
	throw v2
.end method