package N1;

import F7.ExecutorC0117a;
import d3.R0;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;

/* JADX INFO: renamed from: N1.f, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0205f {

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public static final ExecutorC0117a f4529h = new ExecutorC0117a(2);

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final K4.c f4530a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final R0 f4531b;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public List f4534e;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public int f4536g;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final CopyOnWriteArrayList f4533d = new CopyOnWriteArrayList();

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public List f4535f = Collections.EMPTY_LIST;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final ExecutorC0117a f4532c = f4529h;

    public C0205f(K4.c cVar, R0 r02) {
        this.f4530a = cVar;
        this.f4531b = r02;
    }

    public final void a(Runnable runnable) {
        Iterator it = this.f4533d.iterator();
        while (it.hasNext()) {
            ((I) it.next()).f4475a.getClass();
        }
        if (runnable != null) {
            runnable.run();
        }
    }

    public final void b(List list, Runnable runnable) {
        int i = this.f4536g + 1;
        this.f4536g = i;
        List list2 = this.f4534e;
        if (list == list2) {
            if (runnable != null) {
                runnable.run();
                return;
            }
            return;
        }
        K4.c cVar = this.f4530a;
        if (list == null) {
            int size = list2.size();
            this.f4534e = null;
            this.f4535f = Collections.EMPTY_LIST;
            cVar.h(0, size);
            a(runnable);
            return;
        }
        if (list2 != null) {
            ((ExecutorService) this.f4531b.f11692r).execute(new RunnableC0204e(this, list2, list, i, runnable));
            return;
        }
        this.f4534e = list;
        this.f4535f = Collections.unmodifiableList(list);
        cVar.j(0, list.size());
        a(runnable);
    }
}
