package com.google.android.gms.analytics; import com.google.android.gms.common.internal.Preconditions; import com.google.android.gms.common.util.Clock; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; /* loaded from: classes.dex */ public final class zzg { private final zzj zzsc; private final Clock zzsd; private boolean zzse; private long zzsf; private long zzsg; private long zzsh; private long zzsi; private long zzsj; private boolean zzsk; private final Map, zzi> zzsl; private final List zzsm; public final zzg zzai() { return new zzg(this); } public final void zza(zzi zziVar) { Preconditions.checkNotNull(zziVar); Class cls = zziVar.getClass(); if (cls.getSuperclass() != zzi.class) { throw new IllegalArgumentException(); } zziVar.zzb(zzb(cls)); } public final T zza(Class cls) { return (T) this.zzsl.get(cls); } public final T zzb(Class cls) { T t = (T) this.zzsl.get(cls); if (t != null) { return t; } T t2 = (T) zzc(cls); this.zzsl.put(cls, t2); return t2; } public final Collection zzaj() { return this.zzsl.values(); } public final void zzam() { this.zzsc.zzas().zze(this); } /* JADX INFO: Access modifiers changed from: package-private */ public zzg(zzj zzjVar, Clock clock) { Preconditions.checkNotNull(zzjVar); Preconditions.checkNotNull(clock); this.zzsc = zzjVar; this.zzsd = clock; this.zzsi = 1800000L; this.zzsj = 3024000000L; this.zzsl = new HashMap(); this.zzsm = new ArrayList(); } private zzg(zzg zzgVar) { this.zzsc = zzgVar.zzsc; this.zzsd = zzgVar.zzsd; this.zzsf = zzgVar.zzsf; this.zzsg = zzgVar.zzsg; this.zzsh = zzgVar.zzsh; this.zzsi = zzgVar.zzsi; this.zzsj = zzgVar.zzsj; this.zzsm = new ArrayList(zzgVar.zzsm); this.zzsl = new HashMap(zzgVar.zzsl.size()); for (Map.Entry, zzi> entry : zzgVar.zzsl.entrySet()) { zzi zzc = zzc(entry.getKey()); entry.getValue().zzb(zzc); this.zzsl.put(entry.getKey(), zzc); } } private static T zzc(Class cls) { try { return cls.getDeclaredConstructor(new Class[0]).newInstance(new Object[0]); } catch (Exception e) { if (e instanceof InstantiationException) { throw new IllegalArgumentException("dataType doesn't have default constructor", e); } if (e instanceof IllegalAccessException) { throw new IllegalArgumentException("dataType default constructor is not accessible", e); } if (e instanceof ReflectiveOperationException) { throw new IllegalArgumentException("Linkage exception", e); } throw new RuntimeException(e); } } /* JADX INFO: Access modifiers changed from: package-private */ public final void zzao() { this.zzsh = this.zzsd.elapsedRealtime(); long j = this.zzsg; if (j != 0) { this.zzsf = j; } else { this.zzsf = this.zzsd.currentTimeMillis(); } this.zzse = true; } /* JADX INFO: Access modifiers changed from: package-private */ public final void zzar() { this.zzsk = true; } /* JADX INFO: Access modifiers changed from: package-private */ public final boolean zzaq() { return this.zzsk; } /* JADX INFO: Access modifiers changed from: package-private */ public final zzj zzap() { return this.zzsc; } public final boolean zzan() { return this.zzse; } public final long zzal() { return this.zzsf; } public final List zzak() { return this.zzsm; } public final void zza(long j) { this.zzsg = j; } }