package androidx.credentials; import android.os.Bundle; import androidx.annotation.RestrictTo; import androidx.credentials.internal.FrameworkClassParsingException; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.jvm.internal.Intrinsics; /* loaded from: classes.dex */ public abstract class CreateCredentialResponse { public static final Companion Companion = new Companion(null); private static final String EXTRA_CREATE_CREDENTIAL_RESPONSE_DATA = "androidx.credentials.provider.extra.CREATE_CREDENTIAL_REQUEST_DATA"; private static final String EXTRA_CREATE_CREDENTIAL_RESPONSE_TYPE = "androidx.credentials.provider.extra.CREATE_CREDENTIAL_RESPONSE_TYPE"; private final Bundle data; private final String type; @RestrictTo({RestrictTo.Scope.LIBRARY}) public static final Bundle asBundle(CreateCredentialResponse createCredentialResponse) { return Companion.asBundle(createCredentialResponse); } @RestrictTo({RestrictTo.Scope.LIBRARY}) public static final CreateCredentialResponse createFrom(String str, Bundle bundle) { return Companion.createFrom(str, bundle); } @RestrictTo({RestrictTo.Scope.LIBRARY}) public static final CreateCredentialResponse fromBundle(Bundle bundle) { return Companion.fromBundle(bundle); } public final Bundle getData() { return this.data; } public final String getType() { return this.type; } public CreateCredentialResponse(String type, Bundle data) { Intrinsics.checkNotNullParameter(type, "type"); Intrinsics.checkNotNullParameter(data, "data"); this.type = type; this.data = data; } public static final class Companion { public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) { this(); } private Companion() { } @RestrictTo({RestrictTo.Scope.LIBRARY}) public final CreateCredentialResponse createFrom(String type, Bundle data) { Intrinsics.checkNotNullParameter(type, "type"); Intrinsics.checkNotNullParameter(data, "data"); try { if (Intrinsics.areEqual(type, PasswordCredential.TYPE_PASSWORD_CREDENTIAL)) { return CreatePasswordResponse.Companion.createFrom$credentials_release(data); } if (Intrinsics.areEqual(type, PublicKeyCredential.TYPE_PUBLIC_KEY_CREDENTIAL)) { return CreatePublicKeyCredentialResponse.Companion.createFrom$credentials_release(data); } throw new FrameworkClassParsingException(); } catch (FrameworkClassParsingException unused) { return new CreateCustomCredentialResponse(type, data); } } @RestrictTo({RestrictTo.Scope.LIBRARY}) public final CreateCredentialResponse fromBundle(Bundle bundle) { Bundle bundle2; Intrinsics.checkNotNullParameter(bundle, "bundle"); String string = bundle.getString(CreateCredentialResponse.EXTRA_CREATE_CREDENTIAL_RESPONSE_TYPE); if (string == null || (bundle2 = bundle.getBundle(CreateCredentialResponse.EXTRA_CREATE_CREDENTIAL_RESPONSE_DATA)) == null) { return null; } return createFrom(string, bundle2); } @RestrictTo({RestrictTo.Scope.LIBRARY}) public final Bundle asBundle(CreateCredentialResponse response) { Intrinsics.checkNotNullParameter(response, "response"); Bundle bundle = new Bundle(); bundle.putString(CreateCredentialResponse.EXTRA_CREATE_CREDENTIAL_RESPONSE_TYPE, response.getType()); bundle.putBundle(CreateCredentialResponse.EXTRA_CREATE_CREDENTIAL_RESPONSE_DATA, response.getData()); return bundle; } } }