package C1;

import androidx.leanback.widget.SearchBar;
import c1.AbstractC1235j;
import c1.C1232g;
import c1.C1236k;
import java.util.ArrayList;
import java.util.List;
import m4.C2496c1;
import m4.O0;
import u4.C2965a;

/* JADX INFO: loaded from: classes.dex */
public final class b implements Runnable {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f661a;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final Object f663c;

    public /* synthetic */ b(int i6, int i7, Object obj) {
        this.f661a = i7;
        this.f663c = obj;
        this.f662b = i6;
    }

    @Override // java.lang.Runnable
    public final void run() {
        switch (this.f661a) {
            case 0:
                ((android.support.v4.media.session.b) this.f663c).y(this.f662b);
                return;
            case 1:
                ArrayList arrayList = (ArrayList) this.f663c;
                int size = arrayList.size();
                int i6 = 0;
                if (this.f662b != 1) {
                    while (i6 < size) {
                        ((C1232g) arrayList.get(i6)).f13415b.f506b = AbstractC1235j.f13418a;
                        i6++;
                    }
                    return;
                } else {
                    while (i6 < size) {
                        C1232g c1232g = (C1232g) arrayList.get(i6);
                        c1232g.f13414a.setValue(Boolean.TRUE);
                        c1232g.f13415b.f506b = new C1236k(true);
                        i6++;
                    }
                    return;
                }
            case 2:
                SearchBar searchBar = (SearchBar) this.f663c;
                searchBar.f11902w.play(searchBar.f11903x.get(this.f662b), 1.0f, 1.0f, 1, 0, 1.0f);
                return;
            case 3:
                n4.j jVar = (n4.j) this.f663c;
                try {
                    u4.b.c();
                    try {
                        C2965a c2965a = u4.b.f24588a;
                        c2965a.getClass();
                        C2496c1 c2496c1 = jVar.f20925a;
                        int i7 = this.f662b;
                        c2496c1.getClass();
                        A4.g.l(i7 > 0, "numMessages must be > 0");
                        if (!c2496c1.isClosed()) {
                            c2496c1.f20968p += (long) i7;
                            c2496c1.a();
                            break;
                        }
                        c2965a.getClass();
                        return;
                    } catch (Throwable th) {
                        try {
                            u4.b.f24588a.getClass();
                            throw th;
                        } catch (Throwable th2) {
                            th.addSuppressed(th2);
                            throw th;
                        }
                    }
                } catch (Throwable th3) {
                    jVar.m(th3);
                    return;
                }
            default:
                ((O0) this.f663c).f20705f.request(this.f662b);
                return;
        }
    }

    public b(List list, int i6, Throwable th) {
        this.f661a = 1;
        A4.g.n(list, "initCallbacks cannot be null");
        this.f663c = new ArrayList(list);
        this.f662b = i6;
    }
}
