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
	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
	:throw0
	throw p0
.end method

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

	invoke-virtual {p0, p1}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I
	move-result p0
	const/4 p0, 0x1
	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
	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
	:throw0
	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;
	invoke-virtual {v0}, Landroid/net/ConnectivityManager;->getActiveNetworkInfo()Landroid/net/NetworkInfo;
	move-result-object v0
	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
	iget-object v3, p0, Lh1/i0;->d:Lh1/g0;
	const/4 v4, 0x1
	monitor-enter v3
	:try_start_1
	iput-boolean v4, v3, Lh1/g0;->g:Z
	:try_end_1
	.catchall {:try_start_1 .. :try_end_1} :catchall_3
	monitor-exit v3
	iget-object v3, p0, Lh1/i0;->b:Lh1/t;
	invoke-virtual {v3}, Lh1/t;->c()Z
	move-result v3
	goto/32 :cond_2
	:catchall_0
	move-exception v4
	monitor-exit v3
	throw v4
	move-exception v2
	move-exception v3
	: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
	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
	iget-object v2, p0, Lh1/i0;->c:Landroid/os/PowerManager$WakeLock;
	invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
	:cond_3
	return-void
	:cond_4
	iget-object v3, p0, Lh1/i0;->d:Lh1/g0;
	invoke-virtual {v3}, Lh1/g0;->f()Z
	move-result v3
	iget-object v3, p0, Lh1/i0;->d:Lh1/g0;
	monitor-enter v3
	:try_start_9
	iput-boolean v2, v3, Lh1/g0;->g:Z
	:try_end_9
	.catchall {:try_start_9 .. :try_end_9} :catchall_2
	monitor-exit v3
	goto :goto_2
	:catchall_2
	move-exception v4
	monitor-exit v3
	throw v4
	: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
	iget-object v2, p0, Lh1/i0;->c:Landroid/os/PowerManager$WakeLock;
	goto :goto_5
	:catchall_3
	move-exception v4
	monitor-exit v3
	throw v4
	:goto_5
	invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
	:cond_6
	return-void
	:catchall_4
	move-exception v2
	monitor-exit v3
	throw v2
.end method