package com.google.android.play.core.assetpacks; import android.app.Notification; import android.content.ComponentName; import android.content.Context; import android.content.ServiceConnection; import android.os.Bundle; import android.os.IBinder; import android.os.RemoteException; import java.util.ArrayList; import java.util.List; /* loaded from: classes2.dex */ final class b1 implements ServiceConnection { /* renamed from: a, reason: collision with root package name */ private final r3.h0 f4794a = new r3.h0("ExtractionForegroundServiceConnection"); /* renamed from: b, reason: collision with root package name */ private final List f4795b = new ArrayList(); /* renamed from: c, reason: collision with root package name */ private final Context f4796c; /* renamed from: d, reason: collision with root package name */ private ExtractionForegroundService f4797d; /* renamed from: e, reason: collision with root package name */ private Notification f4798e; b1(Context context) { this.f4796c = context; } private final void d() { ArrayList arrayList; synchronized (this.f4795b) { arrayList = new ArrayList(this.f4795b); this.f4795b.clear(); } int size = arrayList.size(); for (int i10 = 0; i10 < size; i10++) { try { ((r3.d0) arrayList.get(i10)).B(new Bundle(), new Bundle()); } catch (RemoteException unused) { this.f4794a.b("Could not resolve Play Store service state update callback.", new Object[0]); } } } final void a(Notification notification) { this.f4798e = notification; } final void b() { this.f4794a.a("Stopping foreground installation service.", new Object[0]); this.f4796c.unbindService(this); ExtractionForegroundService extractionForegroundService = this.f4797d; if (extractionForegroundService != null) { extractionForegroundService.a(); } d(); } final void c(r3.d0 d0Var) { synchronized (this.f4795b) { this.f4795b.add(d0Var); } } @Override // android.content.ServiceConnection public final void onServiceConnected(ComponentName componentName, IBinder iBinder) { this.f4794a.a("Starting foreground installation service.", new Object[0]); ExtractionForegroundService extractionForegroundService = ((a1) iBinder).f4789a; this.f4797d = extractionForegroundService; extractionForegroundService.startForeground(-1883842196, this.f4798e); d(); } @Override // android.content.ServiceConnection public final void onServiceDisconnected(ComponentName componentName) { } }