alexandroid/decompiled/jadx/sources/com/google/firebase/components/Lazy.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

50 lines
1.3 KiB
Java

package com.google.firebase.components;
import androidx.annotation.VisibleForTesting;
import com.google.firebase.inject.Provider;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes8.dex */
public class Lazy<T> implements Provider<T> {
private static final Object UNINITIALIZED = new Object();
private volatile Object instance;
private volatile Provider<T> provider;
public Lazy(T t) {
this.instance = UNINITIALIZED;
this.instance = t;
}
@Override // com.google.firebase.inject.Provider
public T get() {
T t;
T t2 = (T) this.instance;
Object obj = UNINITIALIZED;
if (t2 != obj) {
return t2;
}
synchronized (this) {
try {
t = (T) this.instance;
if (t == obj) {
t = this.provider.get();
this.instance = t;
this.provider = null;
}
} catch (Throwable th) {
throw th;
}
}
return t;
}
@VisibleForTesting
public boolean isInitialized() {
return this.instance != UNINITIALIZED;
}
public Lazy(Provider<T> provider) {
this.instance = UNINITIALIZED;
this.provider = provider;
}
}