package o;

import android.os.Bundle;
import com.google.android.gms.common.internal.Preconditions;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class Hn0 extends AbstractC1039dp0 {
    public final Kr0 a;
    public final Xs0 b;

    public Hn0(Kr0 kr0) {
        Preconditions.checkNotNull(kr0);
        this.a = kr0;
        Xs0 xs0 = kr0.m;
        Kr0.k(xs0);
        this.b = xs0;
    }

    @Override // o.Ys0
    public final void c(String str, String str2, Bundle bundle) {
        Xs0 xs0 = this.b;
        xs0.x(str, str2, bundle, true, true, ((Kr0) xs0.a).k.currentTimeMillis());
    }

    @Override // o.Ys0
    public final long d() {
        C2574tv0 c2574tv0 = this.a.i;
        Kr0.j(c2574tv0);
        return c2574tv0.n0();
    }

    @Override // o.Ys0
    public final void e(String str, String str2, Bundle bundle) {
        Xs0 xs0 = this.a.m;
        Kr0.k(xs0);
        xs0.G(str, str2, bundle);
    }

    @Override // o.Ys0
    public final String f() {
        C2191pt0 c2191pt0 = ((Kr0) this.b.a).l;
        Kr0.k(c2191pt0);
        C1431ht0 c1431ht0 = c2191pt0.c;
        if (c1431ht0 != null) {
            return c1431ht0.a;
        }
        return null;
    }

    @Override // o.Ys0
    public final List g(String str, String str2) {
        Xs0 xs0 = this.b;
        Kr0 kr0 = (Kr0) xs0.a;
        Fr0 fr0 = kr0.g;
        Nq0 nq0 = kr0.f;
        Kr0.l(fr0);
        if (fr0.y()) {
            Kr0.l(nq0);
            nq0.f.b("Cannot get conditional user properties from analytics worker thread");
            return new ArrayList(0);
        }
        if (C2616uQ.x()) {
            Kr0.l(nq0);
            nq0.f.b("Cannot get conditional user properties from main thread");
            return new ArrayList(0);
        }
        AtomicReference atomicReference = new AtomicReference();
        Fr0 fr02 = kr0.g;
        Kr0.l(fr02);
        fr02.C(atomicReference, 5000L, "get conditional user properties", new RunnableC0266Kg(xs0, atomicReference, str, str2));
        List list = (List) atomicReference.get();
        if (list != null) {
            return C2574tv0.g0(list);
        }
        Kr0.l(nq0);
        nq0.f.c(null, "Timed out waiting for get conditional user properties");
        return new ArrayList();
    }

    @Override // o.Ys0
    public final void h(Bundle bundle) {
        Xs0 xs0 = this.b;
        xs0.F(bundle, ((Kr0) xs0.a).k.currentTimeMillis());
    }

    @Override // o.Ys0
    public final int i(String str) {
        Xs0 xs0 = this.b;
        xs0.getClass();
        Preconditions.checkNotEmpty(str);
        ((Kr0) xs0.a).getClass();
        return 25;
    }

    @Override // o.Ys0
    public final String j() {
        return (String) this.b.g.get();
    }

    @Override // o.Ys0
    public final void k(String str) {
        Kr0 kr0 = this.a;
        C2752vp0 c2752vp0 = kr0.n;
        Kr0.i(c2752vp0);
        c2752vp0.u(str, kr0.k.elapsedRealtime());
    }

    @Override // o.Ys0
    public final String l() {
        return this.b.H();
    }

    @Override // o.Ys0
    public final Map m(String str, String str2, boolean z) {
        Xs0 xs0 = this.b;
        Kr0 kr0 = (Kr0) xs0.a;
        Fr0 fr0 = kr0.g;
        Nq0 nq0 = kr0.f;
        Kr0.l(fr0);
        if (fr0.y()) {
            Kr0.l(nq0);
            nq0.f.b("Cannot get user properties from analytics worker thread");
            return Collections.EMPTY_MAP;
        }
        if (C2616uQ.x()) {
            Kr0.l(nq0);
            nq0.f.b("Cannot get user properties from main thread");
            return Collections.EMPTY_MAP;
        }
        AtomicReference atomicReference = new AtomicReference();
        Fr0 fr02 = kr0.g;
        Kr0.l(fr02);
        fr02.C(atomicReference, 5000L, "get user properties", new Zq0(xs0, atomicReference, str, str2, z));
        List<C1910mv0> list = (List) atomicReference.get();
        if (list == null) {
            Kr0.l(nq0);
            nq0.f.c(Boolean.valueOf(z), "Timed out waiting for handle get user properties, includeInternal");
            return Collections.EMPTY_MAP;
        }
        C1839m9 c1839m9 = new C1839m9(list.size());
        for (C1910mv0 c1910mv0 : list) {
            Object objB = c1910mv0.b();
            if (objB != null) {
                c1839m9.put(c1910mv0.m, objB);
            }
        }
        return c1839m9;
    }

    @Override // o.Ys0
    public final void n(String str) {
        Kr0 kr0 = this.a;
        C2752vp0 c2752vp0 = kr0.n;
        Kr0.i(c2752vp0);
        c2752vp0.t(str, kr0.k.elapsedRealtime());
    }

    @Override // o.Ys0
    public final String zzi() {
        C2191pt0 c2191pt0 = ((Kr0) this.b.a).l;
        Kr0.k(c2191pt0);
        C1431ht0 c1431ht0 = c2191pt0.c;
        if (c1431ht0 != null) {
            return c1431ht0.b;
        }
        return null;
    }
}
