package com.android.billingclient.api; import android.content.ComponentName; import android.content.ServiceConnection; import android.os.Handler; import android.os.IBinder; import androidx.work.WorkRequest; import com.google.android.gms.internal.play_billing.zzd; import com.google.android.gms.internal.play_billing.zzgd; import java.util.concurrent.Callable; import java.util.concurrent.Future; /* loaded from: classes.dex */ public final class zzaf implements ServiceConnection { public final /* synthetic */ BillingClientImpl zza; public final Object zzb = new Object(); public boolean zzc = false; public BillingClientStateListener zzd; public /* synthetic */ zzaf(BillingClientImpl billingClientImpl, BillingClientStateListener billingClientStateListener, zzae zzaeVar) { this.zza = billingClientImpl; this.zzd = billingClientStateListener; } @Override // android.content.ServiceConnection public final void onServiceConnected(ComponentName componentName, IBinder iBinder) { Handler zzO; Future zzS; BillingResult zzQ; zzar zzarVar; com.google.android.gms.internal.play_billing.zzb.zzi("BillingClient", "Billing service connected."); this.zza.zzg = zzd.zzn(iBinder); BillingClientImpl billingClientImpl = this.zza; Callable callable = new Callable() { // from class: com.android.billingclient.api.zzac @Override // java.util.concurrent.Callable public final Object call() { zzaf.this.zza(); return null; } }; Runnable runnable = new Runnable() { // from class: com.android.billingclient.api.zzad @Override // java.lang.Runnable public final void run() { zzaf.this.zzb(); } }; zzO = billingClientImpl.zzO(); zzS = billingClientImpl.zzS(callable, WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS, runnable, zzO); if (zzS == null) { zzQ = this.zza.zzQ(); zzarVar = this.zza.zzf; zzarVar.zza(zzaq.zza(25, 6, zzQ)); zzd(zzQ); } } @Override // android.content.ServiceConnection public final void onServiceDisconnected(ComponentName componentName) { zzar zzarVar; com.google.android.gms.internal.play_billing.zzb.zzj("BillingClient", "Billing service disconnected."); zzarVar = this.zza.zzf; zzarVar.zzc(zzgd.zzw()); this.zza.zzg = null; this.zza.zza = 0; synchronized (this.zzb) { try { BillingClientStateListener billingClientStateListener = this.zzd; if (billingClientStateListener != null) { billingClientStateListener.onBillingServiceDisconnected(); } } catch (Throwable th) { throw th; } } } /* JADX WARN: Removed duplicated region for block: B:83:0x01cd */ /* JADX WARN: Removed duplicated region for block: B:85:0x01e0 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final /* synthetic */ java.lang.Object zza() { /* Method dump skipped, instructions count: 501 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.android.billingclient.api.zzaf.zza():java.lang.Object"); } public final /* synthetic */ void zzb() { zzar zzarVar; this.zza.zza = 0; this.zza.zzg = null; zzarVar = this.zza.zzf; BillingResult billingResult = zzat.zzn; zzarVar.zza(zzaq.zza(24, 6, billingResult)); zzd(billingResult); } public final void zzc() { synchronized (this.zzb) { this.zzd = null; this.zzc = true; } } public final void zzd(BillingResult billingResult) { synchronized (this.zzb) { try { BillingClientStateListener billingClientStateListener = this.zzd; if (billingClientStateListener != null) { billingClientStateListener.onBillingSetupFinished(billingResult); } } catch (Throwable th) { throw th; } } } }