package androidx.credentials.provider; import android.os.Build; import android.os.Bundle; import androidx.annotation.RequiresApi; import androidx.credentials.PasswordCredential; import androidx.credentials.PublicKeyCredential; import androidx.credentials.internal.FrameworkClassParsingException; import androidx.credentials.provider.utils.BeginCreateCredentialUtil; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.jvm.internal.Intrinsics; import kotlin.jvm.internal.SourceDebugExtension; /* loaded from: classes.dex */ public abstract class BeginCreateCredentialRequest { public static final Companion Companion = new Companion(null); private final CallingAppInfo callingAppInfo; private final Bundle candidateQueryData; private final String type; public static final Bundle asBundle(BeginCreateCredentialRequest beginCreateCredentialRequest) { return Companion.asBundle(beginCreateCredentialRequest); } public static final BeginCreateCredentialRequest fromBundle(Bundle bundle) { return Companion.fromBundle(bundle); } public final CallingAppInfo getCallingAppInfo() { return this.callingAppInfo; } public final Bundle getCandidateQueryData() { return this.candidateQueryData; } public final String getType() { return this.type; } public BeginCreateCredentialRequest(String type, Bundle candidateQueryData, CallingAppInfo callingAppInfo) { Intrinsics.checkNotNullParameter(type, "type"); Intrinsics.checkNotNullParameter(candidateQueryData, "candidateQueryData"); this.type = type; this.candidateQueryData = candidateQueryData; this.callingAppInfo = callingAppInfo; } @RequiresApi(34) public static final class Api34Impl { public static final Api34Impl INSTANCE = new Api34Impl(); private static final String REQUEST_KEY = "androidx.credentials.provider.BeginCreateCredentialRequest"; private Api34Impl() { } public static final void asBundle(Bundle bundle, BeginCreateCredentialRequest request) { Intrinsics.checkNotNullParameter(bundle, "bundle"); Intrinsics.checkNotNullParameter(request, "request"); bundle.putParcelable(REQUEST_KEY, BeginCreateCredentialUtil.Companion.convertToFrameworkRequest(request)); } public static final BeginCreateCredentialRequest fromBundle(Bundle bundle) { Intrinsics.checkNotNullParameter(bundle, "bundle"); android.service.credentials.BeginCreateCredentialRequest beginCreateCredentialRequest = (android.service.credentials.BeginCreateCredentialRequest) bundle.getParcelable(REQUEST_KEY, android.service.credentials.BeginCreateCredentialRequest.class); if (beginCreateCredentialRequest != null) { return BeginCreateCredentialUtil.Companion.convertToJetpackRequest$credentials_release(beginCreateCredentialRequest); } return null; } } @SourceDebugExtension({"SMAP\nBeginCreateCredentialRequest.kt\nKotlin\n*S Kotlin\n*F\n+ 1 BeginCreateCredentialRequest.kt\nandroidx/credentials/provider/BeginCreateCredentialRequest$Api21Impl\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,149:1\n1#2:150\n*E\n"}) public static final class Api21Impl { private static final String EXTRA_BEGIN_CREATE_CREDENTIAL_REQUEST_CANDIDATE_QUERY_DATA = "androidx.credentials.provider.extra.BEGIN_CREATE_CREDENTIAL_REQUEST_CANDIDATE_QUERY_DATA"; private static final String EXTRA_BEGIN_CREATE_CREDENTIAL_REQUEST_TYPE = "androidx.credentials.provider.extra.BEGIN_CREATE_CREDENTIAL_REQUEST_TYPE"; public static final Api21Impl INSTANCE = new Api21Impl(); private Api21Impl() { } public static final void asBundle(Bundle bundle, BeginCreateCredentialRequest request) { Intrinsics.checkNotNullParameter(bundle, "bundle"); Intrinsics.checkNotNullParameter(request, "request"); bundle.putString(EXTRA_BEGIN_CREATE_CREDENTIAL_REQUEST_TYPE, request.getType()); bundle.putBundle(EXTRA_BEGIN_CREATE_CREDENTIAL_REQUEST_CANDIDATE_QUERY_DATA, request.getCandidateQueryData()); CallingAppInfo callingAppInfo = request.getCallingAppInfo(); if (callingAppInfo != null) { CallingAppInfo.Companion.setCallingAppInfo$credentials_release(bundle, callingAppInfo); } } public static final BeginCreateCredentialRequest fromBundle(Bundle bundle) { Intrinsics.checkNotNullParameter(bundle, "bundle"); String string = bundle.getString(EXTRA_BEGIN_CREATE_CREDENTIAL_REQUEST_TYPE); if (string == null) { return null; } Bundle bundle2 = bundle.getBundle(EXTRA_BEGIN_CREATE_CREDENTIAL_REQUEST_CANDIDATE_QUERY_DATA); if (bundle2 == null) { bundle2 = new Bundle(); } return BeginCreateCredentialRequest.Companion.createFrom$credentials_release(string, bundle2, CallingAppInfo.Companion.extractCallingAppInfo$credentials_release(bundle)); } } public static final class Companion { public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) { this(); } private Companion() { } public final BeginCreateCredentialRequest createFrom$credentials_release(String type, Bundle candidateQueryData, CallingAppInfo callingAppInfo) { BeginCreateCustomCredentialRequest beginCreateCustomCredentialRequest; Intrinsics.checkNotNullParameter(type, "type"); Intrinsics.checkNotNullParameter(candidateQueryData, "candidateQueryData"); try { } catch (FrameworkClassParsingException unused) { beginCreateCustomCredentialRequest = new BeginCreateCustomCredentialRequest(type, candidateQueryData, callingAppInfo); } if (Intrinsics.areEqual(type, PasswordCredential.TYPE_PASSWORD_CREDENTIAL)) { return BeginCreatePasswordCredentialRequest.Companion.createFrom$credentials_release(candidateQueryData, callingAppInfo); } if (Intrinsics.areEqual(type, PublicKeyCredential.TYPE_PUBLIC_KEY_CREDENTIAL)) { return BeginCreatePublicKeyCredentialRequest.Companion.createFrom$credentials_release(candidateQueryData, callingAppInfo); } beginCreateCustomCredentialRequest = new BeginCreateCustomCredentialRequest(type, candidateQueryData, callingAppInfo); return beginCreateCustomCredentialRequest; } public final Bundle asBundle(BeginCreateCredentialRequest request) { Intrinsics.checkNotNullParameter(request, "request"); Bundle bundle = new Bundle(); if (Build.VERSION.SDK_INT >= 34) { Api34Impl.asBundle(bundle, request); } else { Api21Impl.asBundle(bundle, request); } return bundle; } public final BeginCreateCredentialRequest fromBundle(Bundle bundle) { Intrinsics.checkNotNullParameter(bundle, "bundle"); if (Build.VERSION.SDK_INT >= 34) { return Api34Impl.fromBundle(bundle); } return Api21Impl.fromBundle(bundle); } } }