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 du0 extends cu0 {

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

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

    public du0(Context context, a30 a30Var) {
        this.f10521g = context;
        this.f10522h = a30Var;
        this.f10085f = new qt(context, m7.n.C.f30481t.e(), this, this, 1);
    }

    public final com.google.common.util.concurrent.w c(tz tzVar) {
        synchronized (this.f10081b) {
            try {
                if (this.f10082c) {
                    return this.f10080a;
                }
                this.f10082c = true;
                this.f10084e = tzVar;
                this.f10085f.checkAvailabilityAndConnect();
                e30 e30Var = this.f10080a;
                e30Var.g(new z80(this, 17), b30.f9365g);
                cu0.b(this.f10521g, e30Var, this.f10522h);
                return e30Var;
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    @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().d1(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("RemoteSignalsClientTask.onConnected", th);
                        this.f10080a.a(new zzeff(1));
                    }
                }
            } catch (Throwable th2) {
                throw th2;
            }
        }
    }
}
