package androidx.lifecycle;

import android.os.Bundle;
import g0.c;
import java.util.Map;

/* JADX INFO: compiled from: SavedStateHandleSupport.kt */
/* JADX INFO: loaded from: classes.dex */
public final class x implements c.InterfaceC0065c {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private final g0.c f2593a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private boolean f2594b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private Bundle f2595c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private final k1.d f2596d;

    /* JADX INFO: compiled from: SavedStateHandleSupport.kt */
    static final class a extends w1.h implements v1.a<y> {

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        final /* synthetic */ d0 f2597e;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        a(d0 d0Var) {
            super(0);
            this.f2597e = d0Var;
        }

        @Override // v1.a
        /* JADX INFO: renamed from: d, reason: merged with bridge method [inline-methods] */
        public final y a() {
            return w.b(this.f2597e);
        }
    }

    public x(g0.c cVar, d0 d0Var) {
        w1.g.e(cVar, "savedStateRegistry");
        w1.g.e(d0Var, "viewModelStoreOwner");
        this.f2593a = cVar;
        this.f2596d = k1.f.a(new a(d0Var));
    }

    private final y b() {
        return (y) this.f2596d.getValue();
    }

    @Override // g0.c.InterfaceC0065c
    public Bundle a() {
        Bundle bundle = new Bundle();
        Bundle bundle2 = this.f2595c;
        if (bundle2 != null) {
            bundle.putAll(bundle2);
        }
        for (Map.Entry<String, v> entry : b().e().entrySet()) {
            String key = entry.getKey();
            Bundle bundleA = entry.getValue().c().a();
            if (!w1.g.a(bundleA, Bundle.EMPTY)) {
                bundle.putBundle(key, bundleA);
            }
        }
        this.f2594b = false;
        return bundle;
    }

    public final void c() {
        if (this.f2594b) {
            return;
        }
        this.f2595c = this.f2593a.b("androidx.lifecycle.internal.SavedStateHandlesProvider");
        this.f2594b = true;
        b();
    }
}
