package com.google.firebase.analytics;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import com.google.android.gms.common.internal.Preconditions;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import o.AbstractC0752ap;
import o.C0076Cy;
import o.C0232Iy;
import o.C2942xp0;
import o.Ep0;
import o.Hp0;
import o.InterfaceC0258Jy;
import o.Wp0;
import o.Ys0;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class FirebaseAnalytics {
    public static volatile FirebaseAnalytics b;
    public final Wp0 a;

    public FirebaseAnalytics(Wp0 wp0) {
        Preconditions.checkNotNull(wp0);
        this.a = wp0;
    }

    public static FirebaseAnalytics getInstance(Context context) {
        if (b == null) {
            synchronized (FirebaseAnalytics.class) {
                try {
                    if (b == null) {
                        b = new FirebaseAnalytics(Wp0.c(context, null));
                    }
                } finally {
                }
            }
        }
        return b;
    }

    public static Ys0 getScionFrontendApiImplementation(Context context, Bundle bundle) {
        Wp0 wp0C = Wp0.c(context, bundle);
        if (wp0C == null) {
            return null;
        }
        return new C2942xp0(wp0C);
    }

    public String getFirebaseInstanceId() {
        try {
            Object obj = C0232Iy.m;
            C0076Cy c0076CyC = C0076Cy.c();
            Preconditions.checkArgument(true, "Null is not a valid value of FirebaseApp.");
            return (String) AbstractC0752ap.q(((C0232Iy) c0076CyC.b(InterfaceC0258Jy.class)).c(), 30000L, TimeUnit.MILLISECONDS);
        } catch (InterruptedException e) {
            throw new IllegalStateException(e);
        } catch (ExecutionException e2) {
            throw new IllegalStateException(e2.getCause());
        } catch (TimeoutException unused) {
            throw new IllegalThreadStateException("Firebase Installations getId Task has timed out.");
        }
    }

    @Deprecated
    public void setCurrentScreen(Activity activity, String str, String str2) {
        Ep0 ep0B = Ep0.b(activity);
        Wp0 wp0 = this.a;
        wp0.getClass();
        wp0.a(new Hp0(wp0, ep0B, str, str2));
    }
}
