package defpackage;

import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
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;

/* JADX INFO: renamed from: ᵝᵲ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C2957 {

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public static volatile C2957 f11368;

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final AppMeasurementSdk f11369;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final ArrayList f11370;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public boolean f11371;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final ExecutorService f11372;

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public volatile long f11373;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public int f11374;

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public volatile InterfaceC5047 f11375;

    public C2957(Context context, Bundle bundle) {
        ThreadFactoryC1817 threadFactoryC1817 = new ThreadFactoryC1817(this);
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 60L, TimeUnit.SECONDS, new LinkedBlockingQueue(), threadFactoryC1817);
        threadPoolExecutor.allowCoreThreadTimeOut(true);
        this.f11372 = Executors.unconfigurableExecutorService(threadPoolExecutor);
        this.f11369 = new AppMeasurementSdk(this);
        this.f11370 = new ArrayList();
        int i = 0;
        try {
            if (ᵴᵧˈ.ˊᵨᵧ(context, ᵲᵧˇ.ˊᵡᵗʨ(context)) != null) {
                try {
                    Class.forName("com.google.firebase.analytics.FirebaseAnalytics", false, C2957.class.getClassLoader());
                } catch (ClassNotFoundException unused) {
                    this.f11371 = true;
                    return;
                }
            }
        } catch (IllegalStateException unused2) {
        }
        m7046(new C4718(this, context, bundle));
        Application application = (Application) context.getApplicationContext();
        if (application == null) {
            return;
        }
        application.registerActivityLifecycleCallbacks(new C3209(i, this));
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public static C2957 m7044(Context context, Bundle bundle) {
        ᵘᵞʿⁱ.ᵶᵥᵝ(context);
        if (f11368 == null) {
            synchronized (C2957.class) {
                try {
                    if (f11368 == null) {
                        f11368 = new C2957(context, bundle == null ? new Bundle() : new Bundle(bundle));
                    }
                } finally {
                }
            }
        }
        return f11368;
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final int m7045(String str) {
        BinderC0669 binderC0669 = new BinderC0669();
        m7046(new C4718(this, str, binderC0669));
        Integer num = (Integer) BinderC0669.m2443(binderC0669.m2445(10000L), Integer.class);
        if (num == null) {
            return 25;
        }
        return num.intValue();
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final void m7046(AbstractRunnableC1283 abstractRunnableC1283) {
        this.f11372.execute(abstractRunnableC1283);
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final Map m7047(String str, String str2, boolean z) {
        BinderC0669 binderC0669 = new BinderC0669();
        m7046(new C4313(this, str, str2, z, binderC0669));
        Bundle bundleM2445 = binderC0669.m2445(5000L);
        if (bundleM2445 == null || bundleM2445.size() == 0) {
            return Collections.EMPTY_MAP;
        }
        HashMap map = new HashMap(bundleM2445.size());
        for (String str3 : bundleM2445.keySet()) {
            Object obj = bundleM2445.get(str3);
            if ((obj instanceof Double) || (obj instanceof Long) || (obj instanceof String)) {
                map.put(str3, obj);
            }
        }
        return map;
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final long m7048() {
        BinderC0669 binderC0669 = new BinderC0669();
        m7046(new C4711(this, binderC0669, 2));
        Long l = (Long) BinderC0669.m2443(binderC0669.m2445(500L), Long.class);
        if (l != null) {
            return l.longValue();
        }
        long jNextLong = new Random(System.nanoTime() ^ System.currentTimeMillis()).nextLong();
        int i = this.f11374 + 1;
        this.f11374 = i;
        return jNextLong + ((long) i);
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final void m7049(Exception exc, boolean z, boolean z2) {
        this.f11371 |= z;
        if (!z && z2) {
            m7046(new C4924(this, exc));
        }
    }

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public final List m7050(String str, String str2) {
        BinderC0669 binderC0669 = new BinderC0669();
        m7046(new C0951(this, str, str2, binderC0669));
        List list = (List) BinderC0669.m2443(binderC0669.m2445(5000L), List.class);
        return list == null ? Collections.EMPTY_LIST : list;
    }
}
