granularity level: instruction

		.class  Lcom/google/firebase/FirebaseApp$GlobalBackgroundStateListener;
.super Ljava/lang/Object;
.source "FirebaseApp.java"
.implements Lcom/google/android/gms/common/api/internal/BackgroundDetector$BackgroundStateChangeListener;

.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/google/firebase/FirebaseApp;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0xa
name = "GlobalBackgroundStateListener"
.end annotation

.field private static INSTANCE:Ljava/util/concurrent/atomic/AtomicReference;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/concurrent/atomic/AtomicReference<",
"Lcom/google/firebase/FirebaseApp$GlobalBackgroundStateListener;",
">;"
}
.end annotation
.end field


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

	new-instance v0, Ljava/util/concurrent/atomic/AtomicReference;
	invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicReference;-><init>()V
	sput-object v0, Lcom/google/firebase/FirebaseApp$GlobalBackgroundStateListener;->INSTANCE:Ljava/util/concurrent/atomic/AtomicReference;
	return-void
.end method

.method private constructor <init>()V
	.locals 0

	invoke-direct {p0}, Ljava/lang/Object;-><init>()V
	return-void
.end method

.method static synthetic access$100(Landroid/content/Context;)V
	.locals 0

	invoke-static {p0}, Lcom/google/firebase/FirebaseApp$GlobalBackgroundStateListener;->ensureBackgroundStateListenerRegistered(Landroid/content/Context;)V
	return-void
.end method

.method private static ensureBackgroundStateListenerRegistered(Landroid/content/Context;)V
	.locals 3

	invoke-static {}, Lcom/google/android/gms/common/util/PlatformVersion;->isAtLeastIceCreamSandwich()Z
	move-result v0
	if-eqz v0, :cond_1
	invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
	move-result-object v0
	instance-of v0, v0, Landroid/app/Application;
	if-nez v0, :cond_0
	goto :goto_0
	:cond_0
	invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
	move-result-object p0
	check-cast p0, Landroid/app/Application;
	sget-object v0, Lcom/google/firebase/FirebaseApp$GlobalBackgroundStateListener;->INSTANCE:Ljava/util/concurrent/atomic/AtomicReference;
	invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
	move-result-object v0
	if-nez v0, :cond_1
	new-instance v0, Lcom/google/firebase/FirebaseApp$GlobalBackgroundStateListener;
	invoke-direct {v0}, Lcom/google/firebase/FirebaseApp$GlobalBackgroundStateListener;-><init>()V
	sget-object v1, Lcom/google/firebase/FirebaseApp$GlobalBackgroundStateListener;->INSTANCE:Ljava/util/concurrent/atomic/AtomicReference;
	const/4 v2, 0x0
	invoke-static {v1, v2, v0}, Lcom/google/android/gms/common/api/internal/zap$$ExternalSyntheticBackportWithForwarding0;->m(Ljava/util/concurrent/atomic/AtomicReference;Ljava/lang/Object;Ljava/lang/Object;)Z
	move-result v1
	if-eqz v1, :cond_1
	invoke-static {p0}, Lcom/google/android/gms/common/api/internal/BackgroundDetector;->initialize(Landroid/app/Application;)V
	invoke-static {}, Lcom/google/android/gms/common/api/internal/BackgroundDetector;->getInstance()Lcom/google/android/gms/common/api/internal/BackgroundDetector;
	move-result-object p0
	invoke-virtual {p0, v0}, Lcom/google/android/gms/common/api/internal/BackgroundDetector;->addListener(Lcom/google/android/gms/common/api/internal/BackgroundDetector$BackgroundStateChangeListener;)V
	:cond_1
	:goto_0
	return-void
.end method

.method public onBackgroundStateChanged(Z)V
	.locals 4

	invoke-static {}, Lcom/google/firebase/FirebaseApp;->access$300()Ljava/lang/Object;
	move-result-object v0
	monitor-enter v0
	:try_start_0
	new-instance v1, Ljava/util/ArrayList;
	sget-object v2, Lcom/google/firebase/FirebaseApp;->INSTANCES:Ljava/util/Map;
	invoke-interface {v2}, Ljava/util/Map;->values()Ljava/util/Collection;
	move-result-object v2
	invoke-direct {v1, v2}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
	invoke-virtual {v1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
	move-result-object v1
	:goto_0
	:cond_0
	invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
	move-result v2
	if-eqz v2, :cond_1
	invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
	move-result-object v2
	check-cast v2, Lcom/google/firebase/FirebaseApp;
	invoke-static {v2}, Lcom/google/firebase/FirebaseApp;->access$500(Lcom/google/firebase/FirebaseApp;)Ljava/util/concurrent/atomic/AtomicBoolean;
	move-result-object v3
	invoke-virtual {v3}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z
	move-result v3
	if-eqz v3, :cond_0
	invoke-static {v2, p1}, Lcom/google/firebase/FirebaseApp;->access$600(Lcom/google/firebase/FirebaseApp;Z)V
	goto :goto_0
	:cond_1
	monitor-exit v0
	return-void
	:catchall_0
	move-exception p1
	monitor-exit v0
	:try_end_0
	.catchall {:try_start_0 .. :try_end_0} :catchall_0
	throw p1
.end method