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

import android.os.SystemClock;
import androidx.annotation.Nullable;

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

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public long f15469a = -9223372036854775807L;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public long f15470b = -9223372036854775807L;

    @Nullable
    private Exception zza;

    public final void a(Exception exc) {
        long jElapsedRealtime = SystemClock.elapsedRealtime();
        if (this.zza == null) {
            this.zza = exc;
        }
        if (this.f15469a == -9223372036854775807L && qm2.N.get() <= 0) {
            this.f15469a = 200 + jElapsedRealtime;
        }
        long j10 = this.f15469a;
        if (j10 == -9223372036854775807L || jElapsedRealtime < j10) {
            this.f15470b = jElapsedRealtime + 50;
            return;
        }
        Exception exc2 = this.zza;
        if (exc2 != exc) {
            exc2.addSuppressed(exc);
        }
        Exception exc3 = this.zza;
        c();
        throw exc3;
    }

    public final boolean b() {
        if (this.zza == null) {
            return false;
        }
        return (qm2.N.get() > 0) || SystemClock.elapsedRealtime() < this.f15470b;
    }

    public final void c() {
        this.zza = null;
        this.f15469a = -9223372036854775807L;
        this.f15470b = -9223372036854775807L;
    }
}
