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

import android.app.Activity;
import android.content.Context;
import android.os.RemoteException;
import androidx.annotation.Nullable;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;

/* JADX INFO: loaded from: classes2.dex */
public final class nu extends h7.c {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final n7.e4 f14734b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final n7.r0 f14735c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final long f14736d;

    @Nullable
    private h7.d zzg;

    @Nullable
    private g7.j zzh;

    @Nullable
    private g7.n zzi;

    public nu(Context context, String str) {
        uv uvVar = new uv();
        this.f14736d = System.currentTimeMillis();
        new AtomicLong();
        this.f14733a = context;
        new AtomicReference(str);
        this.f14734b = n7.e4.f30941a;
        n7.u uVar = n7.x.f31085g.f31087b;
        n7.f4 f4Var = new n7.f4();
        uVar.getClass();
        this.f14735c = (n7.r0) new n7.l(uVar, context, f4Var, str, uvVar).a(context, false);
    }

    @Override // r7.a
    public final void b(Activity activity) {
        if (activity == null) {
            q7.j.d("The activity for show is null, will proceed with show using the context provided when loading the ad.");
        }
        try {
            n7.r0 r0Var = this.f14735c;
            if (r0Var != null) {
                r0Var.a0(new k8.b(activity));
            }
        } catch (RemoteException e10) {
            q7.j.zzl("#007 Could not call remote method.", e10);
        }
    }

    public final void c(n7.u2 u2Var, com.bumptech.glide.h hVar) {
        try {
            n7.r0 r0Var = this.f14735c;
            if (r0Var != null) {
                u2Var.f31062n = this.f14736d;
                n7.e4 e4Var = this.f14734b;
                Context context = this.f14733a;
                e4Var.getClass();
                r0Var.s1(n7.e4.a(context, u2Var), new n7.v3(hVar, this));
            }
        } catch (RemoteException e10) {
            q7.j.zzl("#007 Could not call remote method.", e10);
            hVar.q(new g7.k(0, "Internal Error.", "com.google.android.gms.ads", null, null));
        }
    }

    @Override // h7.c
    @Nullable
    public final h7.d getAppEventListener() {
        return this.zzg;
    }

    @Override // r7.a
    @Nullable
    public final g7.j getFullScreenContentCallback() {
        return this.zzh;
    }

    @Override // r7.a
    @Nullable
    public final g7.n getOnPaidEventListener() {
        return null;
    }

    @Override // h7.c
    public final void setAppEventListener(@Nullable h7.d dVar) {
        try {
            this.zzg = dVar;
            n7.r0 r0Var = this.f14735c;
            if (r0Var != null) {
                r0Var.zzi(dVar != null ? new oj(dVar) : null);
            }
        } catch (RemoteException e10) {
            q7.j.zzl("#007 Could not call remote method.", e10);
        }
    }

    @Override // r7.a
    public final void setFullScreenContentCallback(@Nullable g7.j jVar) {
        try {
            this.zzh = jVar;
            n7.r0 r0Var = this.f14735c;
            if (r0Var != null) {
                r0Var.o2(new n7.z(jVar));
            }
        } catch (RemoteException e10) {
            q7.j.zzl("#007 Could not call remote method.", e10);
        }
    }

    @Override // r7.a
    public final void setOnPaidEventListener(@Nullable g7.n nVar) {
        try {
            n7.r0 r0Var = this.f14735c;
            if (r0Var != null) {
                r0Var.j2(new n7.o3(nVar));
            }
        } catch (RemoteException e10) {
            q7.j.zzl("#007 Could not call remote method.", e10);
        }
    }

    public nu(Context context, String str, n7.r0 r0Var) {
        n7.e4 e4Var = n7.e4.f30941a;
        new uv();
        this.f14736d = System.currentTimeMillis();
        new AtomicLong();
        this.f14733a = context;
        new AtomicReference(str);
        this.f14734b = e4Var;
        this.f14735c = r0Var;
    }

    public nu(Context context, n7.r0 r0Var) {
        new uv();
        this.f14736d = System.currentTimeMillis();
        new AtomicLong();
        this.f14733a = context;
        new AtomicReference();
        this.f14734b = n7.e4.f30941a;
        this.f14735c = r0Var;
    }
}
