package C3;

/* JADX INFO: renamed from: C3.c, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes3.dex */
public final class C0127c extends B {

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

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final /* synthetic */ Object f712k;

    public /* synthetic */ C0127c(Object obj, int i6) {
        this.f711j = i6;
        this.f712k = obj;
    }

    @Override // C3.B
    public final void b() {
        switch (this.f711j) {
            case 0:
                C0129e c0129e = (C0129e) ((ServiceConnectionC0128d) this.f712k).f714b;
                c0129e.f717b.b("unlinkToDeath", new Object[0]);
                c0129e.f728n.asBinder().unlinkToDeath(c0129e.f726k, 0);
                c0129e.f728n = null;
                c0129e.f722g = false;
                return;
            default:
                synchronized (((C0129e) this.f712k).f721f) {
                    try {
                        if (((C0129e) this.f712k).l.get() > 0 && ((C0129e) this.f712k).l.decrementAndGet() > 0) {
                            ((C0129e) this.f712k).f717b.b("Leaving the connection open for other ongoing calls.", new Object[0]);
                            return;
                        }
                        C0129e c0129e2 = (C0129e) this.f712k;
                        if (c0129e2.f728n != null) {
                            c0129e2.f717b.b("Unbind from service.", new Object[0]);
                            C0129e c0129e3 = (C0129e) this.f712k;
                            c0129e3.f716a.unbindService(c0129e3.f727m);
                            C0129e c0129e4 = (C0129e) this.f712k;
                            c0129e4.f722g = false;
                            c0129e4.f728n = null;
                            c0129e4.f727m = null;
                        }
                        ((C0129e) this.f712k).e();
                        return;
                    } finally {
                    }
                }
        }
    }
}
