package androidx.lifecycle;

import c.l.j;
import c.l.l;
import c.l.n;
import c.l.y;
import c.o.b;

/* JADX INFO: loaded from: classes.dex */
public final class SavedStateHandleController implements l {
    public final String a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public boolean f391b = false;

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

    public SavedStateHandleController(String str, y yVar) {
        this.a = str;
        this.f392c = yVar;
    }

    @Override // c.l.l
    public void g(n nVar, j.a aVar) {
        if (aVar == j.a.ON_DESTROY) {
            this.f391b = false;
            nVar.getLifecycle().c(this);
        }
    }

    public void h(b bVar, j jVar) {
        if (this.f391b) {
            throw new IllegalStateException("Already attached to lifecycleOwner");
        }
        this.f391b = true;
        jVar.a(this);
        bVar.c(this.a, this.f392c.f1804g);
    }
}
