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

import android.content.Context;
import android.os.Bundle;
import android.os.RemoteException;
import androidx.annotation.Nullable;

/* JADX INFO: loaded from: classes2.dex */
public final class d31 implements m61 {

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

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final String f10171c;

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final p7.n0 f10173e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final jd0 f10174f;

    @Nullable
    private final String zzf;

    public d31(Context context, Bundle bundle, String str, String str2, p7.n0 n0Var, @Nullable String str3, jd0 jd0Var) {
        this.f10169a = context;
        this.f10170b = bundle;
        this.f10171c = str;
        this.f10172d = str2;
        this.f10173e = n0Var;
        this.zzf = str3;
        this.f10174f = jd0Var;
    }

    public final void a(Bundle bundle) {
        if (((Boolean) n7.y.f31093e.f31096c.b(ao.f9116v6)).booleanValue()) {
            try {
                p7.r0 r0Var = m7.n.C.f30464c;
                bundle.putString("_app_id", p7.r0.J(this.f10169a));
            } catch (RemoteException | RuntimeException e10) {
                m7.n.C.f30469h.d("AppStatsSignal_AppId", e10);
            }
        }
    }

    @Override // com.google.android.gms.internal.ads.m61
    public final void zza(Object obj) {
        Bundle bundle = ((zd0) obj).f19235a;
        bundle.putBundle("quality_signals", this.f10170b);
        bundle.putString("seq_num", this.f10171c);
        if (!((p7.o0) this.f10173e).C()) {
            bundle.putString("session_id", this.f10172d);
        }
        bundle.putBoolean("client_purpose_one", !r0.C());
        a(bundle);
        String str = this.zzf;
        if (str != null) {
            Bundle bundle2 = new Bundle();
            jd0 jd0Var = this.f10174f;
            Long l10 = (Long) jd0Var.f12814d.get(str);
            bundle2.putLong("dload", l10 == null ? -1L : l10.longValue());
            Integer num = (Integer) jd0Var.f12812b.get(str);
            bundle2.putInt("pcc", num == null ? 0 : num.intValue());
            bundle.putBundle("ad_unit_quality_signals", bundle2);
        }
        if (((Boolean) n7.y.f31093e.f31096c.b(ao.Xa)).booleanValue()) {
            m7.n nVar = m7.n.C;
            if (nVar.f30469h.f15963i.get() > 0) {
                bundle.putInt("nrwv", nVar.f30469h.f15963i.get());
            }
        }
    }

    @Override // com.google.android.gms.internal.ads.m61
    public final /* bridge */ /* synthetic */ void zzb(Object obj) {
        Bundle bundle = ((zd0) obj).f19236b;
        bundle.putBundle("quality_signals", this.f10170b);
        a(bundle);
    }
}
