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;

/* renamed from: ˋⁱᵨ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C1555 {

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public static volatile C1555 f6196;

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public boolean f6197;

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public volatile long f6198;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public volatile InterfaceC3393 f6199;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final ArrayList f6200;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final ExecutorService f6201;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final AppMeasurementSdk f6202;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public int f6203;

    public C1555(Context context, Bundle bundle) throws ClassNotFoundException {
        ThreadFactoryC0892 threadFactoryC0892 = new ThreadFactoryC0892(this);
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 60L, TimeUnit.SECONDS, new LinkedBlockingQueue(), threadFactoryC0892);
        threadPoolExecutor.allowCoreThreadTimeOut(true);
        this.f6201 = Executors.unconfigurableExecutorService(threadPoolExecutor);
        this.f6202 = new AppMeasurementSdk(this);
        this.f6200 = new ArrayList();
        int i = 0;
        try {
            if (ˉᵜˆ.ᵺʙ(context, ᵳʿˉ.ᵡᵘˎʽ(context)) != null) {
                try {
                    Class.forName("com.google.firebase.analytics.FirebaseAnalytics", false, C1555.class.getClassLoader());
                } catch (ClassNotFoundException unused) {
                    this.f6197 = true;
                    return;
                }
            }
        } catch (IllegalStateException unused2) {
        }
        m4513(new C4881(this, context, bundle));
        Application application = (Application) context.getApplicationContext();
        if (application == null) {
            return;
        }
        application.registerActivityLifecycleCallbacks(new C1166(i, this));
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public static C1555 m4510(Context context, Bundle bundle) {
        ᵩʛʽ.ᵝᵵᵺ(context);
        if (f6196 == null) {
            synchronized (C1555.class) {
                try {
                    if (f6196 == null) {
                        f6196 = new C1555(context, bundle == null ? new Bundle() : new Bundle(bundle));
                    }
                } finally {
                }
            }
        }
        return f6196;
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final long m4511() {
        BinderC0209 binderC0209 = new BinderC0209();
        m4513(new C1856(this, binderC0209, 2));
        Long l = (Long) BinderC0209.m1484(binderC0209.m1485(500L), Long.class);
        if (l != null) {
            return l.longValue();
        }
        long jNextLong = new Random(System.nanoTime() ^ System.currentTimeMillis()).nextLong();
        int i = this.f6203 + 1;
        this.f6203 = i;
        return jNextLong + i;
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final List m4512(String str, String str2) {
        BinderC0209 binderC0209 = new BinderC0209();
        m4513(new C1553(this, str, str2, binderC0209));
        List list = (List) BinderC0209.m1484(binderC0209.m1485(5000L), List.class);
        return list == null ? Collections.EMPTY_LIST : list;
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final void m4513(AbstractRunnableC3593 abstractRunnableC3593) {
        this.f6201.execute(abstractRunnableC3593);
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final Map m4514(String str, String str2, boolean z) {
        BinderC0209 binderC0209 = new BinderC0209();
        m4513(new C5224(this, str, str2, z, binderC0209));
        Bundle bundleM1485 = binderC0209.m1485(5000L);
        if (bundleM1485 == null || bundleM1485.size() == 0) {
            return Collections.EMPTY_MAP;
        }
        HashMap map = new HashMap(bundleM1485.size());
        for (String str3 : bundleM1485.keySet()) {
            Object obj = bundleM1485.get(str3);
            if ((obj instanceof Double) || (obj instanceof Long) || (obj instanceof String)) {
                map.put(str3, obj);
            }
        }
        return map;
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final int m4515(String str) {
        BinderC0209 binderC0209 = new BinderC0209();
        m4513(new C4881(this, str, binderC0209));
        Integer num = (Integer) BinderC0209.m1484(binderC0209.m1485(10000L), Integer.class);
        if (num == null) {
            return 25;
        }
        return num.intValue();
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final void m4516(Exception exc, boolean z, boolean z2) {
        this.f6197 |= z;
        if (!z && z2) {
            m4513(new C3372(this, exc));
        }
    }
}
