package com.google.android.gms.measurement.internal; import androidx.annotation.GuardedBy; import java.util.List; /* loaded from: classes3.dex */ public final class zzfn { private static final Object zza = new Object(); private final String zzb; private final zzfl zzc; private final V zzd; private final Object zze; @GuardedBy("overrideLock") private volatile V zzf; @GuardedBy("cachingLock") private volatile V zzg; public final V zza(V v) { List list; synchronized (this.zze) { } if (v != null) { return v; } if (zzfk.zza == null) { return this.zzd; } synchronized (zza) { try { if (zzad.zza()) { return this.zzg == null ? this.zzd : this.zzg; } try { list = zzbh.zzdf; for (zzfn zzfnVar : list) { if (zzad.zza()) { throw new IllegalStateException("Refreshing flag cache must be done on a worker thread."); } V v2 = null; try { zzfl zzflVar = zzfnVar.zzc; if (zzflVar != null) { v2 = zzflVar.zza(); } } catch (IllegalStateException unused) { } synchronized (zza) { zzfnVar.zzg = v2; } } } catch (SecurityException unused2) { } zzfl zzflVar2 = this.zzc; if (zzflVar2 == null) { return this.zzd; } try { return zzflVar2.zza(); } catch (IllegalStateException unused3) { return this.zzd; } catch (SecurityException unused4) { return this.zzd; } } finally { } } } public final String zza() { return this.zzb; } private zzfn(String str, V v, V v2, zzfl zzflVar) { this.zze = new Object(); this.zzf = null; this.zzg = null; this.zzb = str; this.zzd = v; this.zzc = zzflVar; } }