package androidx.credentials.playservices.controllers; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.os.Parcel; import android.os.ResultReceiver; import androidx.credentials.exceptions.CreateCredentialCancellationException; import androidx.credentials.exceptions.CreateCredentialException; import androidx.credentials.exceptions.CreateCredentialInterruptedException; import androidx.credentials.exceptions.CreateCredentialUnknownException; import androidx.credentials.exceptions.GetCredentialCancellationException; import androidx.credentials.exceptions.GetCredentialException; import androidx.credentials.exceptions.GetCredentialInterruptedException; import androidx.credentials.exceptions.GetCredentialUnknownException; import androidx.credentials.exceptions.NoCredentialException; import java.util.Set; import kotlin.collections.SetsKt__SetsKt; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.jvm.internal.Intrinsics; /* loaded from: classes.dex */ public class CredentialProviderBaseController { public static final String ACTIVITY_REQUEST_CODE_TAG = "ACTIVITY_REQUEST_CODE"; public static final String BEGIN_SIGN_IN_TAG = "BEGIN_SIGN_IN"; private static final int CONTROLLER_REQUEST_CODE; public static final String CREATE_CANCELED = "CREATE_CANCELED"; public static final String CREATE_INTERRUPTED = "CREATE_INTERRUPTED"; public static final String CREATE_PASSWORD_TAG = "CREATE_PASSWORD"; public static final String CREATE_PUBLIC_KEY_CREDENTIAL_TAG = "CREATE_PUBLIC_KEY_CREDENTIAL"; public static final String CREATE_UNKNOWN = "CREATE_UNKNOWN"; public static final Companion Companion = new Companion(null); public static final String EXCEPTION_MESSAGE_TAG = "EXCEPTION_MESSAGE"; public static final String EXCEPTION_TYPE_TAG = "EXCEPTION_TYPE"; public static final String EXTRA_GET_CREDENTIAL_INTENT = "EXTRA_GET_CREDENTIAL_INTENT"; public static final String FAILURE_RESPONSE_TAG = "FAILURE_RESPONSE"; public static final String GET_CANCELED = "GET_CANCELED_TAG"; public static final String GET_INTERRUPTED = "GET_INTERRUPTED"; public static final String GET_NO_CREDENTIALS = "GET_NO_CREDENTIALS"; public static final String GET_UNKNOWN = "GET_UNKNOWN"; public static final String REQUEST_TAG = "REQUEST_TYPE"; public static final String RESULT_DATA_TAG = "RESULT_DATA"; public static final String RESULT_RECEIVER_TAG = "RESULT_RECEIVER"; public static final String SIGN_IN_INTENT_TAG = "SIGN_IN_INTENT"; public static final String TYPE_TAG = "TYPE"; private static final Set retryables; private final Context context; public static final class Companion { public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) { this(); } public static /* synthetic */ void getCONTROLLER_REQUEST_CODE$credentials_play_services_auth_release$annotations() { } private Companion() { } public final Set getRetryables() { return CredentialProviderBaseController.retryables; } public final int getCONTROLLER_REQUEST_CODE$credentials_play_services_auth_release() { return CredentialProviderBaseController.CONTROLLER_REQUEST_CODE; } public final GetCredentialException getCredentialExceptionTypeToException$credentials_play_services_auth_release(String str, String str2) { if (str != null) { int hashCode = str.hashCode(); if (hashCode != -1567968963) { if (hashCode != -154594663) { if (hashCode == 1996705159 && str.equals(CredentialProviderBaseController.GET_NO_CREDENTIALS)) { return new NoCredentialException(str2); } } else if (str.equals(CredentialProviderBaseController.GET_INTERRUPTED)) { return new GetCredentialInterruptedException(str2); } } else if (str.equals(CredentialProviderBaseController.GET_CANCELED)) { return new GetCredentialCancellationException(str2); } } return new GetCredentialUnknownException(str2); } public final void reportError$credentials_play_services_auth_release(ResultReceiver resultReceiver, String errName, String errMsg) { Intrinsics.checkNotNullParameter(resultReceiver, ""); Intrinsics.checkNotNullParameter(errName, "errName"); Intrinsics.checkNotNullParameter(errMsg, "errMsg"); Bundle bundle = new Bundle(); bundle.putBoolean(CredentialProviderBaseController.FAILURE_RESPONSE_TAG, true); bundle.putString(CredentialProviderBaseController.EXCEPTION_TYPE_TAG, errName); bundle.putString(CredentialProviderBaseController.EXCEPTION_MESSAGE_TAG, errMsg); resultReceiver.send(Integer.MAX_VALUE, bundle); } public final void reportResult$credentials_play_services_auth_release(ResultReceiver resultReceiver, int i, int i2, Intent intent) { Intrinsics.checkNotNullParameter(resultReceiver, ""); Bundle bundle = new Bundle(); bundle.putBoolean(CredentialProviderBaseController.FAILURE_RESPONSE_TAG, false); bundle.putInt(CredentialProviderBaseController.ACTIVITY_REQUEST_CODE_TAG, i); bundle.putParcelable(CredentialProviderBaseController.RESULT_DATA_TAG, intent); resultReceiver.send(i2, bundle); } public final CreateCredentialException createCredentialExceptionTypeToException$credentials_play_services_auth_release(String str, String str2) { if (Intrinsics.areEqual(str, CredentialProviderBaseController.CREATE_CANCELED)) { return new CreateCredentialCancellationException(str2); } if (Intrinsics.areEqual(str, CredentialProviderBaseController.CREATE_INTERRUPTED)) { return new CreateCredentialInterruptedException(str2); } return new CreateCredentialUnknownException(str2); } } public CredentialProviderBaseController(Context context) { Intrinsics.checkNotNullParameter(context, "context"); this.context = context; } static { Set of; of = SetsKt__SetsKt.setOf((Object[]) new Integer[]{7, 20}); retryables = of; CONTROLLER_REQUEST_CODE = 1; } public final ResultReceiver toIpcFriendlyResultReceiver(T t) { Parcel obtain = Parcel.obtain(); Intrinsics.checkNotNullExpressionValue(obtain, "obtain(...)"); Intrinsics.checkNotNull(t); t.writeToParcel(obtain, 0); obtain.setDataPosition(0); ResultReceiver resultReceiver = (ResultReceiver) ResultReceiver.CREATOR.createFromParcel(obtain); obtain.recycle(); return resultReceiver; } public final void generateHiddenActivityIntent(ResultReceiver resultReceiver, Intent hiddenIntent, String typeTag) { Intrinsics.checkNotNullParameter(resultReceiver, "resultReceiver"); Intrinsics.checkNotNullParameter(hiddenIntent, "hiddenIntent"); Intrinsics.checkNotNullParameter(typeTag, "typeTag"); hiddenIntent.putExtra(TYPE_TAG, typeTag); hiddenIntent.putExtra(ACTIVITY_REQUEST_CODE_TAG, CONTROLLER_REQUEST_CODE); hiddenIntent.putExtra(RESULT_RECEIVER_TAG, toIpcFriendlyResultReceiver(resultReceiver)); hiddenIntent.setFlags(65536); } }