package d1; import android.content.Context; import androidx.work.impl.WorkDatabase; import androidx.work.v; import java.util.UUID; /* loaded from: classes.dex */ public class q implements androidx.work.r { /* renamed from: c, reason: collision with root package name */ static final String f9036c = androidx.work.m.f("WorkProgressUpdater"); /* renamed from: a, reason: collision with root package name */ final WorkDatabase f9037a; /* renamed from: b, reason: collision with root package name */ final e1.a f9038b; class a implements Runnable { /* renamed from: a, reason: collision with root package name */ final /* synthetic */ UUID f9039a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ androidx.work.e f9040b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ androidx.work.impl.utils.futures.c f9041c; a(UUID uuid, androidx.work.e eVar, androidx.work.impl.utils.futures.c cVar) { this.f9039a = uuid; this.f9040b = eVar; this.f9041c = cVar; } @Override // java.lang.Runnable public void run() { c1.p n10; String uuid = this.f9039a.toString(); androidx.work.m c10 = androidx.work.m.c(); String str = q.f9036c; c10.a(str, String.format("Updating progress for %s (%s)", this.f9039a, this.f9040b), new Throwable[0]); q.this.f9037a.c(); try { n10 = q.this.f9037a.B().n(uuid); } finally { try { } finally { } } if (n10 == null) { throw new IllegalStateException("Calls to setProgressAsync() must complete before a ListenableWorker signals completion of work by returning an instance of Result."); } if (n10.f3398b == v.RUNNING) { q.this.f9037a.A().b(new c1.m(uuid, this.f9040b)); } else { androidx.work.m.c().h(str, String.format("Ignoring setProgressAsync(...). WorkSpec (%s) is not in a RUNNING state.", uuid), new Throwable[0]); } this.f9041c.p(null); q.this.f9037a.r(); } } public q(WorkDatabase workDatabase, e1.a aVar) { this.f9037a = workDatabase; this.f9038b = aVar; } @Override // androidx.work.r public v3.a a(Context context, UUID uuid, androidx.work.e eVar) { androidx.work.impl.utils.futures.c t10 = androidx.work.impl.utils.futures.c.t(); this.f9038b.c(new a(uuid, eVar, t10)); return t10; } }