package androidx.credentials.provider; import android.os.Build; import android.os.Bundle; import androidx.annotation.RequiresApi; import androidx.credentials.provider.utils.BeginCreateCredentialUtil; import java.util.ArrayList; import java.util.Collection; import java.util.List; import kotlin.collections.CollectionsKt__CollectionsKt; import kotlin.collections.CollectionsKt___CollectionsKt; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.jvm.internal.Intrinsics; /* loaded from: classes.dex */ public final class BeginCreateCredentialResponse { public static final Companion Companion = new Companion(null); private final List createEntries; private final RemoteEntry remoteEntry; /* JADX WARN: Multi-variable type inference failed */ public BeginCreateCredentialResponse() { this(null, 0 == true ? 1 : 0, 3, 0 == true ? 1 : 0); } public static final Bundle asBundle(BeginCreateCredentialResponse beginCreateCredentialResponse) { return Companion.asBundle(beginCreateCredentialResponse); } public static final BeginCreateCredentialResponse fromBundle(Bundle bundle) { return Companion.fromBundle(bundle); } public final List getCreateEntries() { return this.createEntries; } public final RemoteEntry getRemoteEntry() { return this.remoteEntry; } public BeginCreateCredentialResponse(List createEntries, RemoteEntry remoteEntry) { Intrinsics.checkNotNullParameter(createEntries, "createEntries"); this.createEntries = createEntries; this.remoteEntry = remoteEntry; } public /* synthetic */ BeginCreateCredentialResponse(List list, RemoteEntry remoteEntry, int i, DefaultConstructorMarker defaultConstructorMarker) { this((i & 1) != 0 ? CollectionsKt__CollectionsKt.emptyList() : list, (i & 2) != 0 ? null : remoteEntry); } public static final class Builder { private List createEntries = new ArrayList(); private RemoteEntry remoteEntry; public final Builder setRemoteEntry(RemoteEntry remoteEntry) { this.remoteEntry = remoteEntry; return this; } public final Builder setCreateEntries(List createEntries) { Intrinsics.checkNotNullParameter(createEntries, "createEntries"); this.createEntries = CollectionsKt___CollectionsKt.toMutableList((Collection) createEntries); return this; } public final Builder addCreateEntry(CreateEntry createEntry) { Intrinsics.checkNotNullParameter(createEntry, "createEntry"); this.createEntries.add(createEntry); return this; } public final BeginCreateCredentialResponse build() { return new BeginCreateCredentialResponse(CollectionsKt___CollectionsKt.toList(this.createEntries), this.remoteEntry); } } @RequiresApi(34) public static final class Api34Impl { public static final Api34Impl INSTANCE = new Api34Impl(); private static final String REQUEST_KEY = "androidx.credentials.provider.BeginCreateCredentialResponse"; private Api34Impl() { } public static final void asBundle(Bundle bundle, BeginCreateCredentialResponse response) { Intrinsics.checkNotNullParameter(bundle, "bundle"); Intrinsics.checkNotNullParameter(response, "response"); bundle.putParcelable(REQUEST_KEY, BeginCreateCredentialUtil.Companion.convertToFrameworkResponse(response)); } public static final BeginCreateCredentialResponse fromBundle(Bundle bundle) { Intrinsics.checkNotNullParameter(bundle, "bundle"); android.service.credentials.BeginCreateCredentialResponse beginCreateCredentialResponse = (android.service.credentials.BeginCreateCredentialResponse) bundle.getParcelable(REQUEST_KEY, android.service.credentials.BeginCreateCredentialResponse.class); if (beginCreateCredentialResponse != null) { return BeginCreateCredentialUtil.Companion.convertToJetpackResponse(beginCreateCredentialResponse); } return null; } } @RequiresApi(23) public static final class Api23Impl { public static final Api23Impl INSTANCE = new Api23Impl(); private Api23Impl() { } public static final void asBundle(Bundle bundle, BeginCreateCredentialResponse response) { Intrinsics.checkNotNullParameter(bundle, "bundle"); Intrinsics.checkNotNullParameter(response, "response"); CreateEntry.Companion.marshall$credentials_release(response.getCreateEntries(), bundle); RemoteEntry remoteEntry = response.getRemoteEntry(); if (remoteEntry != null) { RemoteEntry.Companion.marshall$credentials_release(remoteEntry, bundle); } } public static final BeginCreateCredentialResponse fromBundle(Bundle bundle) { Intrinsics.checkNotNullParameter(bundle, "bundle"); List unmarshallCreateEntries$credentials_release = CreateEntry.Companion.unmarshallCreateEntries$credentials_release(bundle); RemoteEntry unmarshallRemoteEntry$credentials_release = RemoteEntry.Companion.unmarshallRemoteEntry$credentials_release(bundle); if (unmarshallCreateEntries$credentials_release.isEmpty() && unmarshallRemoteEntry$credentials_release == null) { return null; } return new BeginCreateCredentialResponse(unmarshallCreateEntries$credentials_release, unmarshallRemoteEntry$credentials_release); } } public static final class Companion { public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) { this(); } private Companion() { } public final Bundle asBundle(BeginCreateCredentialResponse response) { Intrinsics.checkNotNullParameter(response, "response"); Bundle bundle = new Bundle(); if (Build.VERSION.SDK_INT >= 34) { Api34Impl.asBundle(bundle, response); } else { Api23Impl.asBundle(bundle, response); } return bundle; } public final BeginCreateCredentialResponse fromBundle(Bundle bundle) { Intrinsics.checkNotNullParameter(bundle, "bundle"); if (Build.VERSION.SDK_INT >= 34) { return Api34Impl.fromBundle(bundle); } return Api23Impl.fromBundle(bundle); } } }