package b3;

import O1.C;
import P2.C0253j;
import P2.w;
import android.os.Bundle;
import android.os.SystemClock;
import d3.C0764A;
import d3.C0786g1;
import d3.C0795j1;
import d3.C0815q0;
import d3.C0817r0;
import d3.T1;
import d3.U0;
import d3.W1;
import d3.Y0;
import d3.Z;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import q.e;

/* JADX INFO: renamed from: b3.a, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0535a extends AbstractC0537c {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final C0817r0 f9188a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Y0 f9189b;

    public C0535a(C0817r0 c0817r0) {
        w.f(c0817r0);
        this.f9188a = c0817r0;
        Y0 y02 = c0817r0.f12125F;
        C0817r0.j(y02);
        this.f9189b = y02;
    }

    @Override // d3.Z0
    public final String a() {
        return (String) this.f9189b.f11857w.get();
    }

    @Override // d3.Z0
    public final void b(String str) {
        C0817r0 c0817r0 = this.f9188a;
        C0764A c0764a = c0817r0.f12126G;
        C0817r0.h(c0764a);
        c0817r0.D.getClass();
        c0764a.F(SystemClock.elapsedRealtime(), str);
    }

    @Override // d3.Z0
    public final String c() {
        C0795j1 c0795j1 = ((C0817r0) this.f9189b.f5146q).f12124E;
        C0817r0.j(c0795j1);
        C0786g1 c0786g1 = c0795j1.f12020s;
        if (c0786g1 != null) {
            return c0786g1.f11980b;
        }
        return null;
    }

    @Override // d3.Z0
    public final Map d(String str, String str2, boolean z8) {
        Y0 y02 = this.f9189b;
        C0817r0 c0817r0 = (C0817r0) y02.f5146q;
        C0815q0 c0815q0 = c0817r0.f12151z;
        C0817r0.k(c0815q0);
        boolean zQ = c0815q0.Q();
        Z z9 = c0817r0.f12150y;
        if (zQ) {
            C0817r0.k(z9);
            z9.f11875v.b("Cannot get user properties from analytics worker thread");
            return Collections.EMPTY_MAP;
        }
        if (C0253j.s()) {
            C0817r0.k(z9);
            z9.f11875v.b("Cannot get user properties from main thread");
            return Collections.EMPTY_MAP;
        }
        AtomicReference atomicReference = new AtomicReference();
        C0815q0 c0815q02 = c0817r0.f12151z;
        C0817r0.k(c0815q02);
        c0815q02.J(atomicReference, 5000L, "get user properties", new U0(y02, atomicReference, str, str2, z8, 1));
        List<T1> list = (List) atomicReference.get();
        if (list == null) {
            C0817r0.k(z9);
            z9.f11875v.c(Boolean.valueOf(z8), "Timed out waiting for handle get user properties, includeInternal");
            return Collections.EMPTY_MAP;
        }
        e eVar = new e(list.size());
        for (T1 t12 : list) {
            Object objA = t12.a();
            if (objA != null) {
                eVar.put(t12.f11723r, objA);
            }
        }
        return eVar;
    }

    @Override // d3.Z0
    public final void e(String str) {
        C0817r0 c0817r0 = this.f9188a;
        C0764A c0764a = c0817r0.f12126G;
        C0817r0.h(c0764a);
        c0817r0.D.getClass();
        c0764a.G(SystemClock.elapsedRealtime(), str);
    }

    @Override // d3.Z0
    public final int f(String str) {
        Y0 y02 = this.f9189b;
        y02.getClass();
        w.c(str);
        ((C0817r0) y02.f5146q).getClass();
        return 25;
    }

    @Override // d3.Z0
    public final String g() {
        C0795j1 c0795j1 = ((C0817r0) this.f9189b.f5146q).f12124E;
        C0817r0.j(c0795j1);
        C0786g1 c0786g1 = c0795j1.f12020s;
        if (c0786g1 != null) {
            return c0786g1.f11979a;
        }
        return null;
    }

    @Override // d3.Z0
    public final void h(Bundle bundle) {
        Y0 y02 = this.f9189b;
        ((C0817r0) y02.f5146q).D.getClass();
        y02.T(bundle, System.currentTimeMillis());
    }

    @Override // d3.Z0
    public final void i(String str, String str2, Bundle bundle) {
        Y0 y02 = this.f9188a.f12125F;
        C0817r0.j(y02);
        y02.K(str, str2, bundle);
    }

    @Override // d3.Z0
    public final void j(String str, String str2, Bundle bundle) {
        Y0 y02 = this.f9189b;
        ((C0817r0) y02.f5146q).D.getClass();
        y02.O(str, str2, bundle, true, true, System.currentTimeMillis());
    }

    @Override // d3.Z0
    public final long k() {
        W1 w12 = this.f9188a.f12122B;
        C0817r0.i(w12);
        return w12.P0();
    }

    @Override // d3.Z0
    public final String l() {
        return (String) this.f9189b.f11857w.get();
    }

    @Override // d3.Z0
    public final List m(String str, String str2) {
        Y0 y02 = this.f9189b;
        C0817r0 c0817r0 = (C0817r0) y02.f5146q;
        C0815q0 c0815q0 = c0817r0.f12151z;
        C0817r0.k(c0815q0);
        boolean zQ = c0815q0.Q();
        Z z8 = c0817r0.f12150y;
        if (zQ) {
            C0817r0.k(z8);
            z8.f11875v.b("Cannot get conditional user properties from analytics worker thread");
            return new ArrayList(0);
        }
        if (C0253j.s()) {
            C0817r0.k(z8);
            z8.f11875v.b("Cannot get conditional user properties from main thread");
            return new ArrayList(0);
        }
        AtomicReference atomicReference = new AtomicReference();
        C0815q0 c0815q02 = c0817r0.f12151z;
        C0817r0.k(c0815q02);
        c0815q02.J(atomicReference, 5000L, "get conditional user properties", new C(y02, atomicReference, str, str2, 4, false));
        List list = (List) atomicReference.get();
        if (list != null) {
            return W1.R(list);
        }
        C0817r0.k(z8);
        z8.f11875v.c(null, "Timed out waiting for get conditional user properties");
        return new ArrayList();
    }
}
