package androidx.lifecycle;

import r4.AbstractC0983h;

/* JADX INFO: loaded from: classes.dex */
public final class P implements InterfaceC0311s {

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final String f4429k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public final O f4430l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public boolean f4431m;

    public P(String str, O o5) {
        this.f4429k = str;
        this.f4430l = o5;
    }

    @Override // androidx.lifecycle.InterfaceC0311s
    public final void a(InterfaceC0313u interfaceC0313u, EnumC0307n enumC0307n) {
        if (enumC0307n == EnumC0307n.ON_DESTROY) {
            this.f4431m = false;
            interfaceC0313u.getLifecycle().b(this);
        }
    }

    public final void b(AbstractC0309p abstractC0309p, v0.e eVar) {
        AbstractC0983h.e("registry", eVar);
        AbstractC0983h.e("lifecycle", abstractC0309p);
        if (this.f4431m) {
            throw new IllegalStateException("Already attached to lifecycleOwner");
        }
        this.f4431m = true;
        abstractC0309p.a(this);
        eVar.c(this.f4429k, this.f4430l.f4428e);
    }
}
