package o;

import android.os.Bundle;
import java.util.Iterator;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.vp0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2752vp0 extends Vp0 {
    public final C1839m9 b;
    public final C1839m9 c;
    public long d;

    public C2752vp0(Kr0 kr0) {
        super(kr0);
        this.c = new C1839m9(0);
        this.b = new C1839m9(0);
    }

    public final void t(String str, long j) {
        Kr0 kr0 = (Kr0) this.a;
        if (str == null || str.length() == 0) {
            Nq0 nq0 = kr0.f;
            Kr0.l(nq0);
            nq0.f.b("Ad unit id must be a non-empty string");
        } else {
            Fr0 fr0 = kr0.g;
            Kr0.l(fr0);
            fr0.B(new In0(this, str, j, 0));
        }
    }

    public final void u(String str, long j) {
        Kr0 kr0 = (Kr0) this.a;
        if (str == null || str.length() == 0) {
            Nq0 nq0 = kr0.f;
            Kr0.l(nq0);
            nq0.f.b("Ad unit id must be a non-empty string");
        } else {
            Fr0 fr0 = kr0.g;
            Kr0.l(fr0);
            fr0.B(new In0(this, str, j, 1));
        }
    }

    public final void v(long j) {
        C2191pt0 c2191pt0 = ((Kr0) this.a).l;
        Kr0.k(c2191pt0);
        C1431ht0 c1431ht0Y = c2191pt0.y(false);
        C1839m9 c1839m9 = this.b;
        Iterator it = ((C1554j9) c1839m9.keySet()).iterator();
        while (it.hasNext()) {
            String str = (String) it.next();
            x(str, j - ((Long) c1839m9.get(str)).longValue(), c1431ht0Y);
        }
        if (!c1839m9.isEmpty()) {
            w(j - this.d, c1431ht0Y);
        }
        y(j);
    }

    public final void w(long j, C1431ht0 c1431ht0) {
        Kr0 kr0 = (Kr0) this.a;
        if (c1431ht0 == null) {
            Nq0 nq0 = kr0.f;
            Kr0.l(nq0);
            nq0.n.b("Not logging ad exposure. No active activity");
        } else if (j < 1000) {
            Nq0 nq02 = kr0.f;
            Kr0.l(nq02);
            nq02.n.c(Long.valueOf(j), "Not logging ad exposure. Less than 1000 ms. exposure");
        } else {
            Bundle bundle = new Bundle();
            bundle.putLong("_xt", j);
            C2574tv0.i0(c1431ht0, bundle, true);
            Xs0 xs0 = kr0.m;
            Kr0.k(xs0);
            xs0.z("am", "_xa", bundle);
        }
    }

    public final void x(String str, long j, C1431ht0 c1431ht0) {
        Kr0 kr0 = (Kr0) this.a;
        if (c1431ht0 == null) {
            Nq0 nq0 = kr0.f;
            Kr0.l(nq0);
            nq0.n.b("Not logging ad unit exposure. No active activity");
        } else {
            if (j < 1000) {
                Nq0 nq02 = kr0.f;
                Kr0.l(nq02);
                nq02.n.c(Long.valueOf(j), "Not logging ad unit exposure. Less than 1000 ms. exposure");
                return;
            }
            Bundle bundle = new Bundle();
            bundle.putString("_ai", str);
            bundle.putLong("_xt", j);
            C2574tv0.i0(c1431ht0, bundle, true);
            Xs0 xs0 = kr0.m;
            Kr0.k(xs0);
            xs0.z("am", "_xu", bundle);
        }
    }

    public final void y(long j) {
        C1839m9 c1839m9 = this.b;
        Iterator it = ((C1554j9) c1839m9.keySet()).iterator();
        while (it.hasNext()) {
            c1839m9.put((String) it.next(), Long.valueOf(j));
        }
        if (c1839m9.isEmpty()) {
            return;
        }
        this.d = j;
    }
}
