package r3; import android.content.Context; import android.content.ServiceConnection; import android.os.IInterface; import java.util.concurrent.atomic.AtomicInteger; /* loaded from: classes2.dex */ final class m0 extends i0 { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ s0 f13672b; m0(s0 s0Var) { this.f13672b = s0Var; } @Override // r3.i0 public final void a() { Object obj; AtomicInteger atomicInteger; IInterface iInterface; h0 h0Var; Context context; ServiceConnection serviceConnection; AtomicInteger atomicInteger2; h0 h0Var2; obj = this.f13672b.f13688f; synchronized (obj) { atomicInteger = this.f13672b.f13693k; if (atomicInteger.get() > 0) { atomicInteger2 = this.f13672b.f13693k; if (atomicInteger2.decrementAndGet() > 0) { h0Var2 = this.f13672b.f13684b; h0Var2.d("Leaving the connection open for other ongoing calls.", new Object[0]); return; } } s0 s0Var = this.f13672b; iInterface = s0Var.f13695m; if (iInterface != null) { h0Var = s0Var.f13684b; h0Var.d("Unbind from service.", new Object[0]); s0 s0Var2 = this.f13672b; context = s0Var2.f13683a; serviceConnection = s0Var2.f13694l; context.unbindService(serviceConnection); this.f13672b.f13689g = false; this.f13672b.f13695m = null; this.f13672b.f13694l = null; } this.f13672b.w(); } } }