package androidx.lifecycle;

import androidx.lifecycle.n;

/* loaded from: classes.dex */
public final class i implements r {

    /* renamed from: p, reason: collision with root package name */
    private final h f4810p;

    /* renamed from: q, reason: collision with root package name */
    private final r f4811q;

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

        /* renamed from: a, reason: collision with root package name */
        public static final /* synthetic */ int[] f4812a;

        static {
            int[] iArr = new int[n.a.values().length];
            try {
                iArr[n.a.ON_CREATE.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[n.a.ON_START.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                iArr[n.a.ON_RESUME.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                iArr[n.a.ON_PAUSE.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                iArr[n.a.ON_STOP.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                iArr[n.a.ON_DESTROY.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                iArr[n.a.ON_ANY.ordinal()] = 7;
            } catch (NoSuchFieldError unused7) {
            }
            f4812a = iArr;
        }
    }

    public i(h defaultLifecycleObserver, r rVar) {
        kotlin.jvm.internal.t.g(defaultLifecycleObserver, "defaultLifecycleObserver");
        this.f4810p = defaultLifecycleObserver;
        this.f4811q = rVar;
    }

    @Override // androidx.lifecycle.r
    public void f(u source, n.a event) {
        kotlin.jvm.internal.t.g(source, "source");
        kotlin.jvm.internal.t.g(event, "event");
        switch (a.f4812a[event.ordinal()]) {
            case 1:
                this.f4810p.d(source);
                break;
            case 2:
                this.f4810p.onStart(source);
                break;
            case 3:
                this.f4810p.c(source);
                break;
            case 4:
                this.f4810p.g(source);
                break;
            case 5:
                this.f4810p.onStop(source);
                break;
            case 6:
                this.f4810p.onDestroy(source);
                break;
            case 7:
                throw new IllegalArgumentException("ON_ANY must not been send by anybody");
        }
        r rVar = this.f4811q;
        if (rVar != null) {
            rVar.f(source, event);
        }
    }
}
