package com.android.billingclient.api; import android.content.ComponentName; import android.content.ServiceConnection; import android.os.Handler; import android.os.IBinder; import com.google.android.gms.internal.play_billing.zzb; import com.google.android.gms.internal.play_billing.zzhl; import com.google.android.gms.internal.play_billing.zzr; import java.util.concurrent.Callable; import java.util.concurrent.Future; /* loaded from: classes.dex */ final class r implements ServiceConnection { /* renamed from: a, reason: collision with root package name */ private final Object f4069a = new Object(); /* renamed from: b, reason: collision with root package name */ private boolean f4070b = false; /* renamed from: c, reason: collision with root package name */ private n1.c f4071c; /* renamed from: d, reason: collision with root package name */ final /* synthetic */ b f4072d; /* synthetic */ r(b bVar, n1.c cVar, n1.q qVar) { this.f4072d = bVar; this.f4071c = cVar; } private final void c(d dVar) { synchronized (this.f4069a) { n1.c cVar = this.f4071c; if (cVar != null) { cVar.a(dVar); } } } /* JADX WARN: Removed duplicated region for block: B:93:0x0257 */ /* JADX WARN: Removed duplicated region for block: B:94:0x0262 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ final /* synthetic */ java.lang.Object a() { /* Method dump skipped, instructions count: 628 To view this dump change 'Code comments level' option to 'DEBUG' */ throw new UnsupportedOperationException("Method not decompiled: com.android.billingclient.api.r.a():java.lang.Object"); } final /* synthetic */ void b() { this.f4072d.f3908a = 0; this.f4072d.f3914g = null; d dVar = u.f4087n; this.f4072d.Q(s.a(24, 6, dVar)); c(dVar); } @Override // android.content.ServiceConnection public final void onServiceConnected(ComponentName componentName, IBinder iBinder) { Handler K; Future P; d M; zzb.zzj("BillingClient", "Billing service connected."); this.f4072d.f3914g = zzr.zzu(iBinder); Callable callable = new Callable() { // from class: com.android.billingclient.api.p @Override // java.util.concurrent.Callable public final Object call() { r.this.a(); return null; } }; Runnable runnable = new Runnable() { // from class: com.android.billingclient.api.q @Override // java.lang.Runnable public final void run() { r.this.b(); } }; b bVar = this.f4072d; K = bVar.K(); P = bVar.P(callable, 30000L, runnable, K); if (P == null) { b bVar2 = this.f4072d; M = bVar2.M(); bVar2.Q(s.a(25, 6, M)); c(M); } } @Override // android.content.ServiceConnection public final void onServiceDisconnected(ComponentName componentName) { t tVar; zzb.zzk("BillingClient", "Billing service disconnected."); tVar = this.f4072d.f3913f; tVar.a(zzhl.zzz()); this.f4072d.f3914g = null; this.f4072d.f3908a = 0; synchronized (this.f4069a) { n1.c cVar = this.f4071c; if (cVar != null) { cVar.onBillingServiceDisconnected(); } } } }