package com.google.android.gms.internal.ads; import com.google.android.gms.common.util.Clock; import java.util.concurrent.Executor; import org.json.JSONException; import org.json.JSONObject; /* loaded from: classes3.dex */ public final class zzcnr implements zzayk { private zzcex zza; private final Executor zzb; private final zzcnd zzc; private final Clock zzd; private boolean zze = false; private boolean zzf = false; private final zzcng zzg = new zzcng(); public zzcnr(Executor executor, zzcnd zzcndVar, Clock clock) { this.zzb = executor; this.zzc = zzcndVar; this.zzd = clock; } private final void zzg() { try { final JSONObject zzb = this.zzc.zzb(this.zzg); if (this.zza != null) { this.zzb.execute(new Runnable() { // from class: com.google.android.gms.internal.ads.zzcnq @Override // java.lang.Runnable public final void run() { zzcnr.this.zzd(zzb); } }); } } catch (JSONException e) { com.google.android.gms.ads.internal.util.zze.zzb("Failed to call video active view js", e); } } public final void zza() { this.zze = false; } public final void zzb() { this.zze = true; zzg(); } public final /* synthetic */ void zzd(JSONObject jSONObject) { this.zza.zzl("AFMA_updateActiveView", jSONObject); } public final void zze(boolean z) { this.zzf = z; } public final void zzf(zzcex zzcexVar) { this.zza = zzcexVar; } @Override // com.google.android.gms.internal.ads.zzayk public final void zzdn(zzayj zzayjVar) { boolean z = this.zzf ? false : zzayjVar.zzj; zzcng zzcngVar = this.zzg; zzcngVar.zza = z; zzcngVar.zzd = this.zzd.elapsedRealtime(); this.zzg.zzf = zzayjVar; if (this.zze) { zzg(); } } }