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

import android.content.Context;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/* JADX INFO: loaded from: classes2.dex */
public final class a31 implements n61 {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final n8.h f8472b;

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

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

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

    public a31(Context context, r20 r20Var, ScheduledExecutorService scheduledExecutorService, a30 a30Var) {
        if (!((Boolean) n7.y.f31093e.f31096c.b(ao.F3)).booleanValue()) {
            this.f8472b = new n8.h(context);
        }
        this.f8475e = context;
        this.f8471a = r20Var;
        this.f8473c = scheduledExecutorService;
        this.f8474d = a30Var;
    }

    @Override // com.google.android.gms.internal.ads.n61
    public final com.google.common.util.concurrent.w zza() {
        tn tnVar = ao.B3;
        n7.y yVar = n7.y.f31093e;
        if (((Boolean) yVar.f31096c.b(tnVar)).booleanValue()) {
            tn tnVar2 = ao.G3;
            yn ynVar = yVar.f31096c;
            if (!((Boolean) ynVar.b(tnVar2)).booleanValue()) {
                boolean zBooleanValue = ((Boolean) ynVar.b(ao.C3)).booleanValue();
                n8.h hVar = this.f8472b;
                if (!zBooleanValue) {
                    return ih1.h1(ih1.i(hVar.a()), z21.f19056a, b30.f9365g);
                }
                w8.h hVarZzb = ((Boolean) ynVar.b(ao.F3)).booleanValue() ? tb1.zzb(this.f8475e) : hVar.a();
                if (hVarZzb == null) {
                    return ih1.k(new b31(null, -1));
                }
                com.google.common.util.concurrent.w wVarE1 = ih1.e1(ih1.i(hVarZzb), y21.f18650a, b30.f9365g);
                if (((Boolean) ynVar.b(ao.D3)).booleanValue()) {
                    wVarE1 = ih1.Z0(wVarE1, ((Long) ynVar.b(ao.E3)).longValue(), TimeUnit.MILLISECONDS, this.f8473c);
                }
                return ih1.U0(wVarE1, Exception.class, new qz(this, 4), this.f8474d);
            }
        }
        return ih1.k(new b31(null, -1));
    }

    @Override // com.google.android.gms.internal.ads.n61
    public final int zzb() {
        return 11;
    }
}
