package androidx.lifecycle;

import android.os.Bundle;
import d4.C0548g;
import java.util.Map;
import r4.AbstractC0983h;

/* JADX INFO: loaded from: classes.dex */
public final class T implements v0.d {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final v0.e f4442a;

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final C0548g f4445d;

    public T(v0.e eVar, d0 d0Var) {
        AbstractC0983h.e("savedStateRegistry", eVar);
        this.f4442a = eVar;
        this.f4445d = new C0548g(new F0.h(4, d0Var));
    }

    @Override // v0.d
    public final Bundle a() {
        Bundle bundle = new Bundle();
        Bundle bundle2 = this.f4444c;
        if (bundle2 != null) {
            bundle.putAll(bundle2);
        }
        for (Map.Entry entry : ((U) this.f4445d.getValue()).f4446d.entrySet()) {
            String str = (String) entry.getKey();
            Bundle bundleA = ((O) entry.getValue()).f4428e.a();
            if (!AbstractC0983h.a(bundleA, Bundle.EMPTY)) {
                bundle.putBundle(str, bundleA);
            }
        }
        this.f4443b = false;
        return bundle;
    }

    public final void b() {
        if (this.f4443b) {
            return;
        }
        Bundle bundleA = this.f4442a.a("androidx.lifecycle.internal.SavedStateHandlesProvider");
        Bundle bundle = new Bundle();
        Bundle bundle2 = this.f4444c;
        if (bundle2 != null) {
            bundle.putAll(bundle2);
        }
        if (bundleA != null) {
            bundle.putAll(bundleA);
        }
        this.f4444c = bundle;
        this.f4443b = true;
    }
}
