granularity level: instruction

		.class public final Ln0/a;
.super Ljava/lang/Object;
.source "SourceFile"


.field public static final n:J
.field public static volatile o:Ljava/util/concurrent/ScheduledExecutorService;
.field public static final p:Ljava/lang/Object;
.field public final a:Ljava/lang/Object;
.field public final b:Landroid/os/PowerManager$WakeLock;
.field public c:I
.field public d:Ljava/util/concurrent/ScheduledFuture;
.field public e:J
.field public final f:Ljava/util/HashSet;
.field public g:Z
.field public h:Lk0/a;
.field public i:La0/j;
.field public final j:Ljava/lang/String;
.field public final k:Ljava/util/HashMap;
.field public l:Ljava/util/concurrent/atomic/AtomicInteger;
.field public final m:Ljava/util/concurrent/ScheduledExecutorService;


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

	sget-object v0, Ljava/util/concurrent/TimeUnit;->DAYS:Ljava/util/concurrent/TimeUnit;
	const-wide/16 v1, 0x16e
	invoke-virtual {v0, v1, v2}, Ljava/util/concurrent/TimeUnit;->toMillis(J)J
	move-result-wide v0
	sput-wide v0, Ln0/a;->n:J
	const/4 v0, 0x0
	sput-object v0, Ln0/a;->o:Ljava/util/concurrent/ScheduledExecutorService;
	new-instance v0, Ljava/lang/Object;
	invoke-direct {v0}, Ljava/lang/Object;-><init>()V
	sput-object v0, Ln0/a;->p:Ljava/lang/Object;
	return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
	.locals 8

	const-string v0, "wake:com.google.firebase.iid.WakeLockHolder"
	invoke-virtual {p1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
	move-result-object v1
	invoke-direct {p0}, Ljava/lang/Object;-><init>()V
	new-instance v2, Ljava/lang/Object;
	invoke-direct {v2}, Ljava/lang/Object;-><init>()V
	iput-object v2, p0, Ln0/a;->a:Ljava/lang/Object;
	const/4 v2, 0x0
	iput v2, p0, Ln0/a;->c:I
	new-instance v3, Ljava/util/HashSet;
	invoke-direct {v3}, Ljava/util/HashSet;-><init>()V
	iput-object v3, p0, Ln0/a;->f:Ljava/util/HashSet;
	const/4 v3, 0x1
	iput-boolean v3, p0, Ln0/a;->g:Z
	sget-object v4, La0/j;->b:La0/j;
	iput-object v4, p0, Ln0/a;->i:La0/j;
	new-instance v4, Ljava/util/HashMap;
	invoke-direct {v4}, Ljava/util/HashMap;-><init>()V
	iput-object v4, p0, Ln0/a;->k:Ljava/util/HashMap;
	new-instance v4, Ljava/util/concurrent/atomic/AtomicInteger;
	invoke-direct {v4, v2}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>(I)V
	iput-object v4, p0, Ln0/a;->l:Ljava/util/concurrent/atomic/AtomicInteger;
	const-string v4, "WakeLock: wakeLockName must not be empty"
	invoke-static {v4, v0}, Lp0/a;->h(Ljava/lang/String;Ljava/lang/String;)V
	invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
	const/4 v4, 0x0
	iput-object v4, p0, Ln0/a;->h:Lk0/a;
	const-string v5, "com.google.android.gms"
	invoke-virtual {p1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
	move-result-object v6
	invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
	move-result v5
	const-string v5, "*gcore*:"
	invoke-virtual {v0}, Ljava/lang/String;->length()I
	move-result v6
	invoke-virtual {v5, v0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
	move-result-object v5
	iput-object v5, p0, Ln0/a;->j:Ljava/lang/String;
	const-string v5, "power"
	invoke-virtual {p1, v5}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
	move-result-object v5
	check-cast v5, Landroid/os/PowerManager;
	invoke-virtual {v5, v3, v0}, Landroid/os/PowerManager;->newWakeLock(ILjava/lang/String;)Landroid/os/PowerManager$WakeLock;
	move-result-object v0
	iput-object v0, p0, Ln0/a;->b:Landroid/os/PowerManager$WakeLock;
	sget-object v0, Le0/b;->a:Ljava/lang/reflect/Method;
	invoke-virtual {p1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
	move-result-object v0
	invoke-static {p1}, Lf0/b;->a(Landroid/content/Context;)Lj1/c;
	move-result-object v0
	invoke-virtual {p1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
	move-result-object v5
	const-string v6, "android.permission.UPDATE_DEVICE_STATS"
	iget-object v0, v0, Lj1/c;->a:Ljava/lang/Object;
	check-cast v0, Landroid/content/Context;
	invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
	move-result-object v0
	invoke-virtual {v0, v6, v5}, Landroid/content/pm/PackageManager;->checkPermission(Ljava/lang/String;Ljava/lang/String;)I
	move-result v0
	:goto_2
	const/4 v0, 0x0
	:goto_3
	:goto_9
	sget-object p1, Ln0/a;->o:Ljava/util/concurrent/ScheduledExecutorService;
	if-nez p1, :cond_c
	sget-object v0, Ln0/a;->p:Ljava/lang/Object;
	monitor-enter v0
	sget-object p1, Ln0/a;->o:Ljava/util/concurrent/ScheduledExecutorService;
	if-nez p1, :cond_b
	invoke-static {v3}, Ljava/util/concurrent/Executors;->newScheduledThreadPool(I)Ljava/util/concurrent/ScheduledExecutorService;
	move-result-object p1
	invoke-static {p1}, Ljava/util/concurrent/Executors;->unconfigurableScheduledExecutorService(Ljava/util/concurrent/ScheduledExecutorService;)Ljava/util/concurrent/ScheduledExecutorService;
	move-result-object p1
	sput-object p1, Ln0/a;->o:Ljava/util/concurrent/ScheduledExecutorService;
	:cond_b
	monitor-exit v0
	goto :goto_a
	:catchall_0
	move-exception p1
	monitor-exit v0
	:throw0
	throw p1
	:cond_c
	:goto_a
	iput-object p1, p0, Ln0/a;->m:Ljava/util/concurrent/ScheduledExecutorService;
	return-void
.end method

.method public final a(J)V
	.locals 8

	iget-object v0, p0, Ln0/a;->l:Ljava/util/concurrent/atomic/AtomicInteger;
	invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicInteger;->incrementAndGet()I
	sget-wide v0, Ln0/a;->n:J
	const-wide v2, 0x7fffffffffffffffL
	invoke-static {v2, v3, v0, v1}, Ljava/lang/Math;->min(JJ)J
	move-result-wide v0
	const-wide/16 v4, 0x1
	invoke-static {v0, v1, v4, v5}, Ljava/lang/Math;->max(JJ)J
	move-result-wide v0
	const-wide/16 v4, 0x0
	cmp-long v6, p1, v4
	if-lez v6, :cond_0
	invoke-static {p1, p2, v0, v1}, Ljava/lang/Math;->min(JJ)J
	move-result-wide v0
	:cond_0
	iget-object p1, p0, Ln0/a;->a:Ljava/lang/Object;
	monitor-enter p1
	invoke-virtual {p0}, Ln0/a;->b()Z
	move-result p2
	if-nez p2, :cond_1
	sget-object p2, Lk0/a;->a:Lk0/a;
	iput-object p2, p0, Ln0/a;->h:Lk0/a;
	iget-object p2, p0, Ln0/a;->b:Landroid/os/PowerManager$WakeLock;
	invoke-virtual {p2}, Landroid/os/PowerManager$WakeLock;->acquire()V
	iget-object p2, p0, Ln0/a;->i:La0/j;
	invoke-virtual {p2}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
	invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J
	:cond_1
	iget p2, p0, Ln0/a;->c:I
	add-int/lit8 p2, p2, 0x1
	iput p2, p0, Ln0/a;->c:I
	iget-boolean p2, p0, Ln0/a;->g:Z
	const/4 v4, 0x0
	if-eqz p2, :cond_2
	invoke-static {v4}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
	goto :goto_0
	:catchall_0
	move-exception p2
	goto :goto_1
	:goto_0
	:cond_2
	iget-object p2, p0, Ln0/a;->k:Ljava/util/HashMap;
	invoke-virtual {p2, v4}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
	move-result-object p2
	check-cast p2, Ln0/b;
	if-nez p2, :cond_3
	new-instance p2, Ln0/b;
	invoke-direct {p2}, Ln0/b;-><init>()V
	iget-object v5, p0, Ln0/a;->k:Ljava/util/HashMap;
	invoke-virtual {v5, v4, p2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
	:cond_3
	iget v4, p2, Ln0/b;->a:I
	add-int/lit8 v4, v4, 0x1
	iput v4, p2, Ln0/b;->a:I
	iget-object p2, p0, Ln0/a;->i:La0/j;
	invoke-virtual {p2}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
	invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J
	move-result-wide v4
	sub-long v6, v2, v4
	cmp-long p2, v6, v0
	if-lez p2, :cond_4
	add-long v2, v4, v0
	:cond_4
	iget-wide v4, p0, Ln0/a;->e:J
	cmp-long p2, v2, v4
	if-lez p2, :cond_6
	iput-wide v2, p0, Ln0/a;->e:J
	iget-object p2, p0, Ln0/a;->d:Ljava/util/concurrent/ScheduledFuture;
	iget-object p2, p0, Ln0/a;->m:Ljava/util/concurrent/ScheduledExecutorService;
	new-instance v2, Landroidx/lifecycle/b;
	const/4 v3, 0x2
	invoke-direct {v2, v3, p0}, Landroidx/lifecycle/b;-><init>(ILjava/lang/Object;)V
	sget-object v3, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
	invoke-interface {p2, v2, v0, v1, v3}, Ljava/util/concurrent/ScheduledExecutorService;->schedule(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
	move-result-object p2
	iput-object p2, p0, Ln0/a;->d:Ljava/util/concurrent/ScheduledFuture;
	:cond_6
	monitor-exit p1
	return-void
	:goto_1
	monitor-exit p1
	throw p2
.end method

.method public final b()Z
	.locals 2

	iget-object v0, p0, Ln0/a;->a:Ljava/lang/Object;
	monitor-enter v0
	iget v1, p0, Ln0/a;->c:I
	if-lez v1, :cond_0
	const/4 v1, 0x1
	goto :goto_0
	:cond_0
	const/4 v1, 0x0
	:goto_0
	monitor-exit v0
	return v1
	:catchall_0
	move-exception v1
	monitor-exit v0
	:throw0
	throw v1
.end method

.method public final c()V
	.locals 4

	iget-object v0, p0, Ln0/a;->l:Ljava/util/concurrent/atomic/AtomicInteger;
	invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicInteger;->decrementAndGet()I
	move-result v0
	iget-object v0, p0, Ln0/a;->a:Ljava/lang/Object;
	monitor-enter v0
	iget-boolean v1, p0, Ln0/a;->g:Z
	const/4 v2, 0x0
	if-eqz v1, :cond_1
	invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
	goto :goto_0
	:catchall_0
	move-exception v1
	goto :goto_2
	:goto_0
	:cond_1
	iget-object v1, p0, Ln0/a;->k:Ljava/util/HashMap;
	invoke-virtual {v1, v2}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z
	move-result v1
	iget-object v1, p0, Ln0/a;->k:Ljava/util/HashMap;
	invoke-virtual {v1, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
	move-result-object v1
	check-cast v1, Ln0/b;
	if-eqz v1, :cond_3
	iget v3, v1, Ln0/b;->a:I
	add-int/lit8 v3, v3, -0x1
	iput v3, v1, Ln0/b;->a:I
	if-nez v3, :cond_3
	iget-object v1, p0, Ln0/a;->k:Ljava/util/HashMap;
	invoke-virtual {v1, v2}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
	:cond_3
	invoke-virtual {p0}, Ln0/a;->e()V
	monitor-exit v0
	return-void
	:goto_2
	monitor-exit v0
	throw v1
.end method

.method public final d()V
	.locals 2

	iget-object v0, p0, Ln0/a;->f:Ljava/util/HashSet;
	invoke-virtual {v0}, Ljava/util/HashSet;->isEmpty()Z
	move-result v0
	return-void
.end method

.method public final e()V
	.locals 6

	iget-object v0, p0, Ln0/a;->a:Ljava/lang/Object;
	monitor-enter v0
	:try_start_0
	invoke-virtual {p0}, Ln0/a;->b()Z
	move-result v1
	iget-boolean v1, p0, Ln0/a;->g:Z
	const/4 v2, 0x0
	iget v1, p0, Ln0/a;->c:I
	add-int/lit8 v1, v1, -0x1
	iput v1, p0, Ln0/a;->c:I
	invoke-virtual {p0}, Ln0/a;->d()V
	iget-object v1, p0, Ln0/a;->k:Ljava/util/HashMap;
	invoke-virtual {v1}, Ljava/util/HashMap;->values()Ljava/util/Collection;
	move-result-object v1
	invoke-interface {v1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
	move-result-object v1
	:goto_1
	invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
	move-result v3
	iget-object v1, p0, Ln0/a;->k:Ljava/util/HashMap;
	invoke-virtual {v1}, Ljava/util/HashMap;->clear()V
	iget-object v1, p0, Ln0/a;->d:Ljava/util/concurrent/ScheduledFuture;
	const/4 v3, 0x0
	if-eqz v1, :cond_4
	invoke-interface {v1, v2}, Ljava/util/concurrent/Future;->cancel(Z)Z
	iput-object v3, p0, Ln0/a;->d:Ljava/util/concurrent/ScheduledFuture;
	const-wide/16 v1, 0x0
	iput-wide v1, p0, Ln0/a;->e:J
	:cond_4
	iget-object v1, p0, Ln0/a;->b:Landroid/os/PowerManager$WakeLock;
	invoke-virtual {v1}, Landroid/os/PowerManager$WakeLock;->isHeld()Z
	move-result v1
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_1
	iget-object v1, p0, Ln0/a;->b:Landroid/os/PowerManager$WakeLock;
	invoke-virtual {v1}, Landroid/os/PowerManager$WakeLock;->release()V
	:try_start_2
	iget-object v1, p0, Ln0/a;->h:Lk0/a;
	:try_end_2
	.catchall {:try_start_2 .. :try_end_2} :catchall_1
	if-eqz v1, :cond_8
	:try_start_4
	iput-object v3, p0, Ln0/a;->h:Lk0/a;
	:try_end_4
	.catchall {:try_start_4 .. :try_end_4} :catchall_1
	:cond_8
	monitor-exit v0
	return-void
	:catchall_1
	move-exception v1
	monitor-exit v0
	:throw0
	throw v1
.end method