package d2;

import java.util.Iterator;
import java.util.List;
import k1.i;

/* JADX INFO: compiled from: CoroutineExceptionHandlerImpl.kt */
/* JADX INFO: loaded from: classes.dex */
public final class x {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private static final List<v> f4536a = b2.h.d(b2.f.a(w.a()));

    public static final void a(n1.f fVar, Throwable th) {
        Iterator<v> it = f4536a.iterator();
        while (it.hasNext()) {
            try {
                it.next().handleException(fVar, th);
            } catch (Throwable th2) {
                Thread threadCurrentThread = Thread.currentThread();
                threadCurrentThread.getUncaughtExceptionHandler().uncaughtException(threadCurrentThread, y.b(th, th2));
            }
        }
        Thread threadCurrentThread2 = Thread.currentThread();
        try {
            i.a aVar = k1.i.f5165e;
            k1.b.a(th, new h0(fVar));
            k1.i.a(k1.o.f5171a);
        } catch (Throwable th3) {
            i.a aVar2 = k1.i.f5165e;
            k1.i.a(k1.j.a(th3));
        }
        threadCurrentThread2.getUncaughtExceptionHandler().uncaughtException(threadCurrentThread2, th);
    }
}
