package com.google.android.play.core.assetpacks; import java.util.concurrent.atomic.AtomicBoolean; /* loaded from: classes2.dex */ final class e1 { /* renamed from: k, reason: collision with root package name */ private static final r3.h0 f4836k = new r3.h0("ExtractorLooper"); /* renamed from: a, reason: collision with root package name */ private final w1 f4837a; /* renamed from: b, reason: collision with root package name */ private final y0 f4838b; /* renamed from: c, reason: collision with root package name */ private final f3 f4839c; /* renamed from: d, reason: collision with root package name */ private final i2 f4840d; /* renamed from: e, reason: collision with root package name */ private final m2 f4841e; /* renamed from: f, reason: collision with root package name */ private final u2 f4842f; /* renamed from: g, reason: collision with root package name */ private final y2 f4843g; /* renamed from: h, reason: collision with root package name */ private final z1 f4844h; /* renamed from: i, reason: collision with root package name */ private final AtomicBoolean f4845i = new AtomicBoolean(false); /* renamed from: j, reason: collision with root package name */ private final r3.o f4846j; e1(w1 w1Var, r3.o oVar, y0 y0Var, f3 f3Var, i2 i2Var, m2 m2Var, u2 u2Var, y2 y2Var, z1 z1Var) { this.f4837a = w1Var; this.f4846j = oVar; this.f4838b = y0Var; this.f4839c = f3Var; this.f4840d = i2Var; this.f4841e = m2Var; this.f4842f = u2Var; this.f4843g = y2Var; this.f4844h = z1Var; } private final void b(int i10, Exception exc) { try { this.f4837a.k(i10, 5); this.f4837a.l(i10); } catch (d1 unused) { f4836k.b("Error during error handling: %s", exc.getMessage()); } } final void a() { y1 y1Var; r3.h0 h0Var = f4836k; h0Var.a("Run extractor loop", new Object[0]); if (!this.f4845i.compareAndSet(false, true)) { h0Var.e("runLoop already looping; return", new Object[0]); return; } while (true) { try { y1Var = this.f4844h.a(); } catch (d1 e10) { f4836k.b("Error while getting next extraction task: %s", e10.getMessage()); if (e10.f4816a >= 0) { ((t3) this.f4846j.a()).a(e10.f4816a); b(e10.f4816a, e10); } y1Var = null; } if (y1Var == null) { this.f4845i.set(false); return; } try { if (y1Var instanceof x0) { this.f4838b.a((x0) y1Var); } else if (y1Var instanceof e3) { this.f4839c.a((e3) y1Var); } else if (y1Var instanceof h2) { this.f4840d.a((h2) y1Var); } else if (y1Var instanceof k2) { this.f4841e.a((k2) y1Var); } else if (y1Var instanceof t2) { this.f4842f.a((t2) y1Var); } else if (y1Var instanceof w2) { this.f4843g.a((w2) y1Var); } else { f4836k.b("Unknown task type: %s", y1Var.getClass().getName()); } } catch (Exception e11) { f4836k.b("Error during extraction task: %s", e11.getMessage()); ((t3) this.f4846j.a()).a(y1Var.f5164a); b(y1Var.f5164a, e11); } } } }