package C3;

import com.google.android.gms.tasks.TaskCompletionSource;

/* JADX INFO: loaded from: classes3.dex */
public final class D extends B {

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final /* synthetic */ TaskCompletionSource f705j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final /* synthetic */ B f706k;
    public final /* synthetic */ C0129e l;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public D(C0129e c0129e, TaskCompletionSource taskCompletionSource, TaskCompletionSource taskCompletionSource2, B b5) {
        super(taskCompletionSource);
        this.l = c0129e;
        this.f705j = taskCompletionSource2;
        this.f706k = b5;
    }

    @Override // C3.B
    public final void b() {
        synchronized (this.l.f721f) {
            try {
                C0129e c0129e = this.l;
                TaskCompletionSource taskCompletionSource = this.f705j;
                c0129e.f720e.add(taskCompletionSource);
                taskCompletionSource.getTask().addOnCompleteListener(new T.p(3, c0129e, taskCompletionSource));
                if (this.l.l.getAndIncrement() > 0) {
                    this.l.f717b.b("Already connected to the service.", new Object[0]);
                }
                C0129e.b(this.l, this.f706k);
            } catch (Throwable th) {
                throw th;
            }
        }
    }
}
