package k6;

import ek.d;
import java.util.concurrent.Executor;

/* loaded from: classes.dex */
public abstract class a {

    /* renamed from: a, reason: collision with root package name */
    public static final r.a f25417a = new C0531a();

    /* renamed from: k6.a$a, reason: collision with other inner class name */
    /* loaded from: classes.dex */
    class C0531a implements r.a {
        C0531a() {
        }

        @Override // r.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public Void apply(byte[] bArr) {
            return null;
        }
    }

    /* loaded from: classes.dex */
    class b implements Runnable {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ d f25418p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ r.a f25419q;

        /* renamed from: r, reason: collision with root package name */
        final /* synthetic */ androidx.work.impl.utils.futures.c f25420r;

        b(d dVar, r.a aVar, androidx.work.impl.utils.futures.c cVar) {
            this.f25418p = dVar;
            this.f25419q = aVar;
            this.f25420r = cVar;
        }

        @Override // java.lang.Runnable
        public void run() {
            try {
                this.f25420r.o(this.f25419q.apply(this.f25418p.get()));
            } catch (Throwable th2) {
                th = th2;
                Throwable cause = th.getCause();
                if (cause != null) {
                    th = cause;
                }
                this.f25420r.p(th);
            }
        }
    }

    public static d a(d dVar, r.a aVar, Executor executor) {
        androidx.work.impl.utils.futures.c s10 = androidx.work.impl.utils.futures.c.s();
        dVar.addListener(new b(dVar, aVar, s10), executor);
        return s10;
    }
}
