package com.google.android.gms.internal.ads; import android.os.Bundle; import android.os.Parcelable; import com.google.android.gms.common.util.Clock; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; /* loaded from: classes3.dex */ public final class zzbzf { private final Clock zza; private final zzbzq zzb; private final String zze; private final String zzf; private final Object zzd = new Object(); private long zzg = -1; private long zzh = -1; private long zzi = 0; private long zzj = -1; private long zzk = -1; private final LinkedList zzc = new LinkedList(); public zzbzf(Clock clock, zzbzq zzbzqVar, String str, String str2) { this.zza = clock; this.zzb = zzbzqVar; this.zze = str; this.zzf = str2; } public final Bundle zza() { Bundle bundle; synchronized (this.zzd) { try { bundle = new Bundle(); bundle.putString("seq_num", this.zze); bundle.putString("slotid", this.zzf); bundle.putBoolean("ismediation", false); bundle.putLong("treq", this.zzj); bundle.putLong("tresponse", this.zzk); bundle.putLong("timp", this.zzg); bundle.putLong("tload", this.zzh); bundle.putLong("pcc", this.zzi); bundle.putLong("tfetch", -1L); ArrayList arrayList = new ArrayList<>(); Iterator it = this.zzc.iterator(); while (it.hasNext()) { arrayList.add(((zzbze) it.next()).zzb()); } bundle.putParcelableArrayList("tclick", arrayList); } catch (Throwable th) { throw th; } } return bundle; } public final String zzc() { return this.zze; } public final void zzd() { synchronized (this.zzd) { try { if (this.zzk != -1) { zzbze zzbzeVar = new zzbze(this); zzbzeVar.zzd(); this.zzc.add(zzbzeVar); this.zzi++; this.zzb.zzf(); this.zzb.zze(this); } } catch (Throwable th) { throw th; } } } public final void zze() { synchronized (this.zzd) { try { if (this.zzk != -1 && !this.zzc.isEmpty()) { zzbze zzbzeVar = (zzbze) this.zzc.getLast(); if (zzbzeVar.zza() == -1) { zzbzeVar.zzc(); this.zzb.zze(this); } } } catch (Throwable th) { throw th; } } } public final void zzf() { synchronized (this.zzd) { try { if (this.zzk != -1 && this.zzg == -1) { this.zzg = this.zza.elapsedRealtime(); this.zzb.zze(this); } this.zzb.zzg(); } catch (Throwable th) { throw th; } } } public final void zzg() { synchronized (this.zzd) { this.zzb.zzh(); } } public final void zzh(boolean z) { synchronized (this.zzd) { try { if (this.zzk != -1) { this.zzh = this.zza.elapsedRealtime(); } } catch (Throwable th) { throw th; } } } public final void zzi() { synchronized (this.zzd) { this.zzb.zzi(); } } public final void zzj(com.google.android.gms.ads.internal.client.zzm zzmVar) { synchronized (this.zzd) { long elapsedRealtime = this.zza.elapsedRealtime(); this.zzj = elapsedRealtime; this.zzb.zzj(zzmVar, elapsedRealtime); } } public final void zzk(long j) { synchronized (this.zzd) { try { this.zzk = j; if (j != -1) { this.zzb.zze(this); } } catch (Throwable th) { throw th; } } } }