package androidx.core.view;

import androidx.lifecycle.Lifecycle$Event;
import androidx.lifecycle.Lifecycle$State;
import androidx.lifecycle.LifecycleEventObserver;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class x implements LifecycleEventObserver {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ Object f1854b;

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

    public /* synthetic */ x(Object obj, Object obj2, int i10) {
        this.f1853a = i10;
        this.f1854b = obj;
        this.f1855c = obj2;
    }

    @Override // androidx.lifecycle.LifecycleEventObserver
    public final void onStateChanged(androidx.lifecycle.p pVar, Lifecycle$Event lifecycle$Event) {
        int i10 = this.f1853a;
        Object obj = this.f1855c;
        Object obj2 = this.f1854b;
        switch (i10) {
            case 0:
                a0 a0Var = (a0) obj2;
                c0 c0Var = (c0) obj;
                if (lifecycle$Event == Lifecycle$Event.ON_DESTROY) {
                    a0Var.b(c0Var);
                    return;
                } else {
                    a0Var.getClass();
                    return;
                }
            default:
                androidx.lifecycle.m mVar = (androidx.lifecycle.m) obj2;
                kotlinx.coroutines.y0 y0Var = (kotlinx.coroutines.y0) obj;
                nb.g.i(mVar, "this$0");
                nb.g.i(y0Var, "$parentJob");
                nb.g.i(pVar, "source");
                nb.g.i(lifecycle$Event, "<anonymous parameter 1>");
                if (((androidx.lifecycle.r) pVar.getLifecycle()).f2692c == Lifecycle$State.f2631a) {
                    y0Var.e(null);
                    mVar.a();
                    return;
                }
                int iCompareTo = ((androidx.lifecycle.r) pVar.getLifecycle()).f2692c.compareTo(mVar.f2669b);
                androidx.lifecycle.e eVar = mVar.f2670c;
                if (iCompareTo < 0) {
                    eVar.f2646a = true;
                    return;
                } else {
                    if (eVar.f2646a) {
                        if (!(!eVar.f2647b)) {
                            throw new IllegalStateException("Cannot resume a finished dispatcher".toString());
                        }
                        eVar.f2646a = false;
                        eVar.a();
                        return;
                    }
                    return;
                }
        }
    }
}
