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

import android.content.Context;
import android.os.RemoteException;
import androidx.annotation.Nullable;
import com.google.android.gms.ads.AdFormat;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static h20 f9315c;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Context f9316a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final AdFormat f9317b;

    @Nullable
    private final n7.u2 zzc;

    @Nullable
    private final String zzd;

    public az(Context context, AdFormat adFormat, @Nullable n7.u2 u2Var, @Nullable String str) {
        this.f9316a = context;
        this.f9317b = adFormat;
        this.zzc = u2Var;
        this.zzd = str;
    }

    @Nullable
    public static h20 zza(Context context) {
        h20 h20Var;
        synchronized (az.class) {
            try {
                if (f9315c == null) {
                    f9315c = n7.x.f31085g.f31087b.zzj(context, new uv());
                }
                h20Var = f9315c;
            } catch (Throwable th) {
                throw th;
            }
        }
        return h20Var;
    }

    public final void a(w7.b bVar) {
        n7.a4 a4VarA;
        long jCurrentTimeMillis = System.currentTimeMillis();
        Context context = this.f9316a;
        h20 h20VarZza = zza(context);
        if (h20VarZza == null) {
            bVar.a("Internal Error, query info generator is null.");
            return;
        }
        k8.b bVar2 = new k8.b(context);
        n7.u2 u2Var = this.zzc;
        if (u2Var == null) {
            n7.b4 b4Var = new n7.b4();
            b4Var.f30928m = jCurrentTimeMillis;
            a4VarA = b4Var.a();
        } else {
            u2Var.f31062n = jCurrentTimeMillis;
            a4VarA = n7.e4.a(context, u2Var);
        }
        try {
            h20VarZza.zze(bVar2, new l20(this.zzd, this.f9317b.name(), null, a4VarA, 0, null), new zy(this, bVar));
        } catch (RemoteException unused) {
            bVar.a("Internal Error.");
        }
    }
}
