package androidx.credentials;

import android.os.Bundle;
import androidx.credentials.internal.FrameworkClassParsingException;
import androidx.media3.container.NalUnitUtil;
import androidx.media3.exoplayer.rtsp.SessionDescription;
import defpackage.cr4;
import defpackage.kp6;
import defpackage.m38;
import defpackage.pq6;
import defpackage.uz1;
import defpackage.x15;
import kotlin.Metadata;

/* JADX INFO: loaded from: classes.dex */
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\b&\u0018\u0000 \u000b2\u00020\u0001:\u0001\u000bB\u0017\b\u0000\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006R\u0011\u0010\u0004\u001a\u00020\u0005¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\bR\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\t\u0010\n¨\u0006\f"}, d2 = {"Landroidx/credentials/CreateCredentialResponse;", "", SessionDescription.ATTR_TYPE, "", "data", "Landroid/os/Bundle;", "(Ljava/lang/String;Landroid/os/Bundle;)V", "getData", "()Landroid/os/Bundle;", "getType", "()Ljava/lang/String;", "Companion", "credentials_release"}, k = 1, mv = {1, 8, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
public abstract class CreateCredentialResponse {

    /* JADX INFO: renamed from: Companion, reason: from kotlin metadata */
    @kp6
    public static final Companion INSTANCE = new Companion(null);

    @kp6
    private static final String EXTRA_CREATE_CREDENTIAL_RESPONSE_DATA = "androidx.credentials.provider.extra.CREATE_CREDENTIAL_REQUEST_DATA";

    @kp6
    private static final String EXTRA_CREATE_CREDENTIAL_RESPONSE_TYPE = "androidx.credentials.provider.extra.CREATE_CREDENTIAL_RESPONSE_TYPE";

    @kp6
    private final Bundle data;

    @kp6
    private final String type;

    @Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\b\u0080\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\tH\u0007J\u0018\u0010\n\u001a\u00020\t2\u0006\u0010\u000b\u001a\u00020\u00042\u0006\u0010\f\u001a\u00020\u0007H\u0007J\u0012\u0010\r\u001a\u0004\u0018\u00010\t2\u0006\u0010\u000e\u001a\u00020\u0007H\u0007R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000¨\u0006\u000f"}, d2 = {"Landroidx/credentials/CreateCredentialResponse$Companion;", "", "()V", "EXTRA_CREATE_CREDENTIAL_RESPONSE_DATA", "", "EXTRA_CREATE_CREDENTIAL_RESPONSE_TYPE", "asBundle", "Landroid/os/Bundle;", "response", "Landroidx/credentials/CreateCredentialResponse;", "createFrom", SessionDescription.ATTR_TYPE, "data", "fromBundle", "bundle", "credentials_release"}, k = 1, mv = {1, 8, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static final class Companion {
        public /* synthetic */ Companion(uz1 uz1Var) {
            this();
        }

        @m38
        @x15
        @kp6
        public final Bundle asBundle(@kp6 CreateCredentialResponse response) {
            cr4.g(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;
        }

        @m38
        @x15
        @kp6
        public final CreateCredentialResponse createFrom(@kp6 String type, @kp6 Bundle data) {
            cr4.g(type, SessionDescription.ATTR_TYPE);
            cr4.g(data, "data");
            try {
                if (type.equals(PasswordCredential.TYPE_PASSWORD_CREDENTIAL)) {
                    return CreatePasswordResponse.INSTANCE.createFrom$credentials_release(data);
                }
                if (type.equals(PublicKeyCredential.TYPE_PUBLIC_KEY_CREDENTIAL)) {
                    return CreatePublicKeyCredentialResponse.INSTANCE.createFrom$credentials_release(data);
                }
                throw new FrameworkClassParsingException();
            } catch (FrameworkClassParsingException unused) {
                return new CreateCustomCredentialResponse(type, data);
            }
        }

        @m38
        @pq6
        @x15
        public final CreateCredentialResponse fromBundle(@kp6 Bundle bundle) {
            Bundle bundle2;
            cr4.g(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);
        }

        private Companion() {
        }
    }

    public CreateCredentialResponse(@kp6 String str, @kp6 Bundle bundle) {
        cr4.g(str, SessionDescription.ATTR_TYPE);
        cr4.g(bundle, "data");
        this.type = str;
        this.data = bundle;
    }

    @m38
    @x15
    @kp6
    public static final Bundle asBundle(@kp6 CreateCredentialResponse createCredentialResponse) {
        return INSTANCE.asBundle(createCredentialResponse);
    }

    @m38
    @x15
    @kp6
    public static final CreateCredentialResponse createFrom(@kp6 String str, @kp6 Bundle bundle) {
        return INSTANCE.createFrom(str, bundle);
    }

    @m38
    @pq6
    @x15
    public static final CreateCredentialResponse fromBundle(@kp6 Bundle bundle) {
        return INSTANCE.fromBundle(bundle);
    }

    @kp6
    public final Bundle getData() {
        return this.data;
    }

    @kp6
    public final String getType() {
        return this.type;
    }
}
