package androidx.activity.result;

import androidx.activity.result.d;
import androidx.lifecycle.f;
import androidx.lifecycle.j;
import androidx.lifecycle.l;

/* JADX INFO: loaded from: classes.dex */
class ActivityResultRegistry$1 implements j {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    final /* synthetic */ String f35b;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    final /* synthetic */ b f36f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    final /* synthetic */ androidx.activity.result.g.a f37g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    final /* synthetic */ d f38h;

    @Override // androidx.lifecycle.j
    public void d(l lVar, f.b bVar) {
        if (!f.b.ON_START.equals(bVar)) {
            if (f.b.ON_STOP.equals(bVar)) {
                this.f38h.f44e.remove(this.f35b);
                return;
            } else {
                if (f.b.ON_DESTROY.equals(bVar)) {
                    this.f38h.k(this.f35b);
                    return;
                }
                return;
            }
        }
        this.f38h.f44e.put(this.f35b, new d.b<>(this.f36f, this.f37g));
        if (this.f38h.f45f.containsKey(this.f35b)) {
            Object obj = this.f38h.f45f.get(this.f35b);
            this.f38h.f45f.remove(this.f35b);
            this.f36f.a(obj);
        }
        a aVar = (a) this.f38h.f46g.getParcelable(this.f35b);
        if (aVar != null) {
            this.f38h.f46g.remove(this.f35b);
            this.f36f.a(this.f37g.c(aVar.b(), aVar.a()));
        }
    }
}
