package com.google.android.gms.internal.ads;

import android.os.SystemClock;
import java.util.concurrent.atomic.AtomicBoolean;

/* JADX INFO: loaded from: classes2.dex */
public final class ip1 {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final AtomicBoolean f12601b = new AtomicBoolean(false);

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public long f12602c = -1;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public long f12603d = -1;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public Throwable f12604e = null;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final int f12605f;

    public ip1(int i10, fl1 fl1Var) {
        this.f12605f = i10;
        this.f12600a = fl1Var;
    }

    public final void a() {
        if (this.f12601b.get()) {
            throw new IllegalStateException("Finished trace.");
        }
        this.f12602c = SystemClock.uptimeMillis();
    }

    public final void b(Throwable th) {
        if (this.f12601b.get()) {
            throw new IllegalStateException("Finished trace.");
        }
        this.f12604e = th;
    }

    public final void c() {
        AtomicBoolean atomicBoolean = this.f12601b;
        if (atomicBoolean.getAndSet(true)) {
            throw new IllegalStateException("Finished trace.");
        }
        this.f12603d = SystemClock.uptimeMillis();
        ((ml1) this.f12600a).a(this.f12605f - 1, atomicBoolean.get() ? this.f12603d - this.f12602c : -1L, this.f12604e, null);
    }
}
