package o;

import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.util.Clock;
import com.google.android.gms.common.util.DefaultClock;
import java.util.ArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class Wp0 {
    public static volatile Wp0 h;
    public final Clock a = DefaultClock.getInstance();
    public final ExecutorService b;
    public final OD c;
    public final ArrayList d;
    public int e;
    public boolean f;
    public volatile InterfaceC1993np0 g;

    public Wp0(Context context, Bundle bundle) throws ClassNotFoundException {
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 60L, TimeUnit.SECONDS, new LinkedBlockingQueue(), new ThreadFactoryC0068Cq(this));
        int i = 1;
        threadPoolExecutor.allowCoreThreadTimeOut(true);
        this.b = Executors.unconfigurableExecutorService(threadPoolExecutor);
        this.c = new OD(10, this);
        this.d = new ArrayList();
        int i2 = 0;
        try {
            if (AbstractC0662Zn.N(context, AbstractC2946xr0.a(context)) != null) {
                try {
                    Class.forName("com.google.firebase.analytics.FirebaseAnalytics", false, Wp0.class.getClassLoader());
                } catch (ClassNotFoundException unused) {
                    this.f = true;
                    return;
                }
            }
        } catch (IllegalStateException unused2) {
        }
        a(new Ip0(this, context, bundle, i2));
        Application application = (Application) context.getApplicationContext();
        if (application == null) {
            return;
        }
        application.registerActivityLifecycleCallbacks(new C0308Lx(i, this));
    }

    public static Wp0 c(Context context, Bundle bundle) {
        Preconditions.checkNotNull(context);
        if (h == null) {
            synchronized (Wp0.class) {
                try {
                    if (h == null) {
                        h = new Wp0(context, bundle);
                    }
                } finally {
                }
            }
        }
        return h;
    }

    public final void a(Rp0 rp0) {
        this.b.execute(rp0);
    }

    public final void b(Exception exc, boolean z, boolean z2) {
        this.f |= z;
        if (!z && z2) {
            a(new Fp0(this, exc));
        }
    }
}
