package androidx.credentials.provider;

import android.os.Build;
import android.os.Bundle;
import androidx.credentials.provider.utils.BeginGetCredentialUtil;
import androidx.media3.container.NalUnitUtil;
import defpackage.cr4;
import defpackage.kp6;
import defpackage.l18;
import defpackage.n41;
import defpackage.pq6;
import defpackage.s15;
import defpackage.uz1;
import defpackage.vx8;
import defpackage.x15;
import java.util.ArrayList;
import java.util.List;
import kotlin.Metadata;

/* JADX INFO: loaded from: classes.dex */
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\t\u0018\u0000 \u000e2\u00020\u0001:\u0003\f\r\u000eB!\b\u0007\u0012\f\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003\u0012\n\b\u0002\u0010\u0005\u001a\u0004\u0018\u00010\u0006¢\u0006\u0002\u0010\u0007R\u0017\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\tR\u0013\u0010\u0005\u001a\u0004\u0018\u00010\u0006¢\u0006\b\n\u0000\u001a\u0004\b\n\u0010\u000b¨\u0006\u000f"}, d2 = {"Landroidx/credentials/provider/BeginGetCredentialRequest;", "", "beginGetCredentialOptions", "", "Landroidx/credentials/provider/BeginGetCredentialOption;", "callingAppInfo", "Landroidx/credentials/provider/CallingAppInfo;", "(Ljava/util/List;Landroidx/credentials/provider/CallingAppInfo;)V", "getBeginGetCredentialOptions", "()Ljava/util/List;", "getCallingAppInfo", "()Landroidx/credentials/provider/CallingAppInfo;", "Api21Impl", "Api34Impl", "Companion", "credentials_release"}, k = 1, mv = {1, 8, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
public final class BeginGetCredentialRequest {

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

    @kp6
    private final List<BeginGetCredentialOption> beginGetCredentialOptions;

    @pq6
    private final CallingAppInfo callingAppInfo;

    @Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\u0006\bÂ\u0002\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003J\u001f\u0010\t\u001a\u00020\b2\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0007\u001a\u00020\u0006H\u0007¢\u0006\u0004\b\t\u0010\nJ\u0019\u0010\u000b\u001a\u0004\u0018\u00010\u00062\u0006\u0010\u0005\u001a\u00020\u0004H\u0007¢\u0006\u0004\b\u000b\u0010\fR\u0014\u0010\u000e\u001a\u00020\r8\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u000e\u0010\u000fR\u0014\u0010\u0010\u001a\u00020\r8\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0010\u0010\u000fR\u0014\u0010\u0011\u001a\u00020\r8\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0011\u0010\u000fR\u0014\u0010\u0012\u001a\u00020\r8\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0012\u0010\u000f¨\u0006\u0013"}, d2 = {"Landroidx/credentials/provider/BeginGetCredentialRequest$Api21Impl;", "", "<init>", "()V", "Landroid/os/Bundle;", "bundle", "Landroidx/credentials/provider/BeginGetCredentialRequest;", "request", "Le6a;", "asBundle", "(Landroid/os/Bundle;Landroidx/credentials/provider/BeginGetCredentialRequest;)V", "fromBundle", "(Landroid/os/Bundle;)Landroidx/credentials/provider/BeginGetCredentialRequest;", "", "EXTRA_BEGIN_GET_CREDENTIAL_OPTION_SIZE", "Ljava/lang/String;", "EXTRA_BEGIN_GET_CREDENTIAL_OPTION_ID_PREFIX", "EXTRA_BEGIN_GET_CREDENTIAL_OPTION_TYPE_PREFIX", "EXTRA_BEGIN_GET_CREDENTIAL_OPTION_CANDIDATE_QUERY_DATA_PREFIX", "credentials_release"}, k = 1, mv = {1, 8, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    @vx8
    public static final class Api21Impl {

        @kp6
        private static final String EXTRA_BEGIN_GET_CREDENTIAL_OPTION_CANDIDATE_QUERY_DATA_PREFIX = "androidx.credentials.provider.extra.EXTRA_BEGIN_GET_CREDENTIAL_OPTION_CANDIDATE_QUERY_DATA_";

        @kp6
        private static final String EXTRA_BEGIN_GET_CREDENTIAL_OPTION_ID_PREFIX = "androidx.credentials.provider.extra.EXTRA_BEGIN_GET_CREDENTIAL_OPTION_ID_";

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

        @kp6
        private static final String EXTRA_BEGIN_GET_CREDENTIAL_OPTION_TYPE_PREFIX = "androidx.credentials.provider.extra.EXTRA_BEGIN_GET_CREDENTIAL_OPTION_TYPE_";

        @kp6
        public static final Api21Impl INSTANCE = new Api21Impl();

        private Api21Impl() {
        }

        @x15
        public static final void asBundle(@kp6 Bundle bundle, @kp6 BeginGetCredentialRequest request) {
            cr4.g(bundle, "bundle");
            cr4.g(request, "request");
            int size = request.getBeginGetCredentialOptions().size();
            bundle.putInt(EXTRA_BEGIN_GET_CREDENTIAL_OPTION_SIZE, size);
            for (int i = 0; i < size; i++) {
                bundle.putString(n41.k(EXTRA_BEGIN_GET_CREDENTIAL_OPTION_ID_PREFIX, i), request.getBeginGetCredentialOptions().get(i).getId());
                bundle.putString(EXTRA_BEGIN_GET_CREDENTIAL_OPTION_TYPE_PREFIX + i, request.getBeginGetCredentialOptions().get(i).getType());
                bundle.putBundle(EXTRA_BEGIN_GET_CREDENTIAL_OPTION_CANDIDATE_QUERY_DATA_PREFIX + i, request.getBeginGetCredentialOptions().get(i).getCandidateQueryData());
                CallingAppInfo callingAppInfo = request.getCallingAppInfo();
                if (callingAppInfo != null) {
                    CallingAppInfo.INSTANCE.setCallingAppInfo$credentials_release(bundle, callingAppInfo);
                }
            }
        }

        @pq6
        @x15
        public static final BeginGetCredentialRequest fromBundle(@kp6 Bundle bundle) {
            cr4.g(bundle, "bundle");
            CallingAppInfo callingAppInfoExtractCallingAppInfo$credentials_release = CallingAppInfo.INSTANCE.extractCallingAppInfo$credentials_release(bundle);
            int i = bundle.getInt(EXTRA_BEGIN_GET_CREDENTIAL_OPTION_SIZE, -1);
            if (i < 0) {
                return null;
            }
            ArrayList arrayList = new ArrayList();
            for (int i2 = 0; i2 < i; i2++) {
                String string = bundle.getString(EXTRA_BEGIN_GET_CREDENTIAL_OPTION_ID_PREFIX + i2);
                if (string == null) {
                    return null;
                }
                String string2 = bundle.getString(EXTRA_BEGIN_GET_CREDENTIAL_OPTION_TYPE_PREFIX + i2);
                if (string2 == null) {
                    return null;
                }
                Bundle bundle2 = bundle.getBundle(EXTRA_BEGIN_GET_CREDENTIAL_OPTION_CANDIDATE_QUERY_DATA_PREFIX + i2);
                if (bundle2 == null) {
                    bundle2 = new Bundle();
                }
                arrayList.add(BeginGetCredentialOption.INSTANCE.createFrom$credentials_release(string, string2, bundle2));
            }
            return new BeginGetCredentialRequest(arrayList, callingAppInfoExtractCallingAppInfo$credentials_release);
        }
    }

    @l18
    @Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\u0003\bÃ\u0002\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003J\u001f\u0010\t\u001a\u00020\b2\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0007\u001a\u00020\u0006H\u0007¢\u0006\u0004\b\t\u0010\nJ\u0019\u0010\u000b\u001a\u0004\u0018\u00010\u00062\u0006\u0010\u0005\u001a\u00020\u0004H\u0007¢\u0006\u0004\b\u000b\u0010\fR\u0014\u0010\u000e\u001a\u00020\r8\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u000e\u0010\u000f¨\u0006\u0010"}, d2 = {"Landroidx/credentials/provider/BeginGetCredentialRequest$Api34Impl;", "", "<init>", "()V", "Landroid/os/Bundle;", "bundle", "Landroidx/credentials/provider/BeginGetCredentialRequest;", "request", "Le6a;", "asBundle", "(Landroid/os/Bundle;Landroidx/credentials/provider/BeginGetCredentialRequest;)V", "fromBundle", "(Landroid/os/Bundle;)Landroidx/credentials/provider/BeginGetCredentialRequest;", "", "REQUEST_KEY", "Ljava/lang/String;", "credentials_release"}, k = 1, mv = {1, 8, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static final class Api34Impl {

        @kp6
        public static final Api34Impl INSTANCE = new Api34Impl();

        @kp6
        private static final String REQUEST_KEY = "androidx.credentials.provider.BeginGetCredentialRequest";

        private Api34Impl() {
        }

        @x15
        public static final void asBundle(@kp6 Bundle bundle, @kp6 BeginGetCredentialRequest request) {
            cr4.g(bundle, "bundle");
            cr4.g(request, "request");
            bundle.putParcelable(REQUEST_KEY, BeginGetCredentialUtil.INSTANCE.convertToFrameworkRequest(request));
        }

        @pq6
        @x15
        public static final BeginGetCredentialRequest fromBundle(@kp6 Bundle bundle) {
            cr4.g(bundle, "bundle");
            android.service.credentials.BeginGetCredentialRequest beginGetCredentialRequest = (android.service.credentials.BeginGetCredentialRequest) bundle.getParcelable(REQUEST_KEY, android.service.credentials.BeginGetCredentialRequest.class);
            if (beginGetCredentialRequest != null) {
                return BeginGetCredentialUtil.INSTANCE.convertToJetpackRequest$credentials_release(beginGetCredentialRequest);
            }
            return null;
        }
    }

    @Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007J\u0012\u0010\u0007\u001a\u0004\u0018\u00010\u00062\u0006\u0010\b\u001a\u00020\u0004H\u0007¨\u0006\t"}, d2 = {"Landroidx/credentials/provider/BeginGetCredentialRequest$Companion;", "", "()V", "asBundle", "Landroid/os/Bundle;", "request", "Landroidx/credentials/provider/BeginGetCredentialRequest;", "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();
        }

        @x15
        @kp6
        public final Bundle asBundle(@kp6 BeginGetCredentialRequest request) {
            cr4.g(request, "request");
            Bundle bundle = new Bundle();
            if (Build.VERSION.SDK_INT >= 34) {
                Api34Impl.asBundle(bundle, request);
                return bundle;
            }
            Api21Impl.asBundle(bundle, request);
            return bundle;
        }

        @pq6
        @x15
        public final BeginGetCredentialRequest fromBundle(@kp6 Bundle bundle) {
            cr4.g(bundle, "bundle");
            return Build.VERSION.SDK_INT >= 34 ? Api34Impl.fromBundle(bundle) : Api21Impl.fromBundle(bundle);
        }

        private Companion() {
        }
    }

    /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
    /* JADX WARN: Multi-variable type inference failed */
    @s15
    public BeginGetCredentialRequest(@kp6 List<? extends BeginGetCredentialOption> list) {
        this(list, null, 2, 0 == true ? 1 : 0);
        cr4.g(list, "beginGetCredentialOptions");
    }

    @x15
    @kp6
    public static final Bundle asBundle(@kp6 BeginGetCredentialRequest beginGetCredentialRequest) {
        return INSTANCE.asBundle(beginGetCredentialRequest);
    }

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

    @kp6
    public final List<BeginGetCredentialOption> getBeginGetCredentialOptions() {
        return this.beginGetCredentialOptions;
    }

    @pq6
    public final CallingAppInfo getCallingAppInfo() {
        return this.callingAppInfo;
    }

    /* JADX WARN: Multi-variable type inference failed */
    @s15
    public BeginGetCredentialRequest(@kp6 List<? extends BeginGetCredentialOption> list, @pq6 CallingAppInfo callingAppInfo) {
        cr4.g(list, "beginGetCredentialOptions");
        this.beginGetCredentialOptions = list;
        this.callingAppInfo = callingAppInfo;
    }

    public /* synthetic */ BeginGetCredentialRequest(List list, CallingAppInfo callingAppInfo, int i, uz1 uz1Var) {
        this(list, (i & 2) != 0 ? null : callingAppInfo);
    }
}
