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

import android.content.Context;
import android.os.Bundle;
import android.os.RemoteException;
import java.util.concurrent.Executor;

/* JADX INFO: loaded from: classes2.dex */
public final class yt0 extends cu0 {

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

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final Executor f18974h;

    public yt0(Context context, a30 a30Var) {
        this.f18973g = context;
        this.f18974h = a30Var;
        this.f10085f = new qt(context, m7.n.C.f30481t.e(), this, this, 1);
    }

    @Override // com.google.android.gms.internal.ads.cu0, com.google.android.gms.common.internal.b
    public final void onConnected(Bundle bundle) {
        synchronized (this.f10081b) {
            try {
                if (!this.f10083d) {
                    this.f10083d = true;
                    try {
                        this.f10085f.d().S(this.f10084e, ((Boolean) n7.y.f31093e.f31096c.b(ao.f8909ie)).booleanValue() ? new bu0(this.f10080a, this.f10084e) : new au0(this));
                    } catch (RemoteException | IllegalArgumentException unused) {
                        this.f10080a.a(new zzeff(1));
                    } catch (Throwable th) {
                        m7.n.C.f30469h.d("RemoteAdRequestClientTask.onConnected", th);
                        this.f10080a.a(new zzeff(1));
                    }
                }
            } catch (Throwable th2) {
                throw th2;
            }
        }
    }

    @Override // com.google.android.gms.internal.ads.cu0, com.google.android.gms.common.internal.c
    public final void onConnectionFailed(e8.b bVar) {
        q7.j.a("Cannot connect to remote service, fallback to local instance.");
        this.f10080a.a(new zzeff(1));
    }
}
