Search in sources :

Example 16 with FirebaseAuthAnonymousUpgradeException

use of com.firebase.ui.auth.FirebaseAuthAnonymousUpgradeException in project FirebaseUI-Android by firebase.

the class GenericIdpSignInHandler method handleMergeFailure.

protected void handleMergeFailure(@NonNull AuthCredential credential) {
    IdpResponse failureResponse = new IdpResponse.Builder().setPendingCredential(credential).build();
    setResult(Resource.forFailure(new FirebaseAuthAnonymousUpgradeException(ErrorCodes.ANONYMOUS_UPGRADE_MERGE_CONFLICT, failureResponse)));
}
Also used : FirebaseAuthAnonymousUpgradeException(com.firebase.ui.auth.FirebaseAuthAnonymousUpgradeException) IdpResponse(com.firebase.ui.auth.IdpResponse)

Aggregations

FirebaseAuthAnonymousUpgradeException (com.firebase.ui.auth.FirebaseAuthAnonymousUpgradeException)16 IdpResponse (com.firebase.ui.auth.IdpResponse)14 Resource (com.firebase.ui.auth.data.model.Resource)8 InOrder (org.mockito.InOrder)8 FirebaseUiException (com.firebase.ui.auth.FirebaseUiException)7 Test (org.junit.Test)7 ViewModelProvider (androidx.lifecycle.ViewModelProvider)6 AuthCredential (com.google.firebase.auth.AuthCredential)6 FirebaseAuthUserCollisionException (com.google.firebase.auth.FirebaseAuthUserCollisionException)4 Intent (android.content.Intent)3 TextView (android.widget.TextView)3 AuthUI (com.firebase.ui.auth.AuthUI)3 User (com.firebase.ui.auth.data.model.User)3 UserCancellationException (com.firebase.ui.auth.data.model.UserCancellationException)3 EmailAuthCredential (com.google.firebase.auth.EmailAuthCredential)3 FakeSignInMethodQueryResult (com.firebase.ui.auth.testhelpers.FakeSignInMethodQueryResult)2 FirebaseAuthError (com.firebase.ui.auth.util.FirebaseAuthError)2 SocialProviderResponseHandler (com.firebase.ui.auth.viewmodel.idp.SocialProviderResponseHandler)2 FacebookAuthCredential (com.google.firebase.auth.FacebookAuthCredential)2 FirebaseAuthException (com.google.firebase.auth.FirebaseAuthException)2