Source:
<code>public void startSignIn(@NonNull final String email, @NonNull final String password, @NonNull final IdpResponse inputResponse, @Nullable final AuthCredential credential) { mSignInLiveData.setValue(new Resource<IdpResponse>()); final IdpResponse outputResponse; if (credential == null) { outputResponse = new IdpResponse.Builder( new User.Builder(EmailAuthProvider.PROVIDER_ID, email).build()) .build(); } else { outputResponse = new IdpResponse.Builder(inputResponse.getUser()) .setToken(inputResponse.getIdpToken()) .setSecret(inputResponse.getIdpSecret()) .build(); } getAuth().signInWithEmailAndPassword(email, password) .addOnFailureListener(new TaskFailureLogger(TAG, "signInWithEmailAndPassword failed.")) .continueWithTask(new Continuation<AuthResult, Task<AuthResult>>() { @Override public Task<AuthResult> then(@NonNull Task<AuthResult> task) throws Exception { if (!task.isSuccessful()) { throw task.getException(); } if (credential == null) { return Tasks.forResult(task.getResult()); } else { return task.getResult().getUser() .linkWithCredential(credential) .continueWithTask(new ProfileMerger(outputResponse)) .addOnFailureListener(new TaskFailureLogger(TAG, "linkWithCredential+merge failed.")); } } }) .addOnCompleteListener(new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (!task.isSuccessful()) { <START> mSignInLiveData.setValue(new Resource<IdpResponse>(task.getException())); <END> return; } AuthResult authResult = task.getResult(); saveCredentialsOrFinish(authResult.getUser(), password, outputResponse); } }); }</code><technical_language>Yep, I concluded in PR too</technical_language>

Target:
public void startSignIn(@NonNull final String email, @NonNull final String password, @NonNull final IdpResponse inputResponse, @Nullable final AuthCredential credential) { mSignInLiveData.setValue(new Resource<IdpResponse>()); final IdpResponse outputResponse; if (credential == null) { outputResponse = new IdpResponse.Builder( new User.Builder(EmailAuthProvider.PROVIDER_ID, email).build()) .build(); } else { outputResponse = new IdpResponse.Builder(inputResponse.getUser()) .setToken(inputResponse.getIdpToken()) .setSecret(inputResponse.getIdpSecret()) .build(); } getAuth().signInWithEmailAndPassword(email, password) .addOnFailureListener(new TaskFailureLogger(TAG, "signInWithEmailAndPassword failed.")) .continueWithTask(new Continuation<AuthResult, Task<AuthResult>>() { @Override public Task<AuthResult> then(@NonNull Task<AuthResult> task) throws Exception { AuthResult result = task.getResult(Exception.class); if (credential == null) { return Tasks.forResult(result); } else { return result.getUser() .linkWithCredential(credential) .continueWithTask(new ProfileMerger(outputResponse)) .addOnFailureListener(new TaskFailureLogger(TAG, "linkWithCredential+merge failed.")); } } }) .addOnCompleteListener(new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (!task.isSuccessful()) { mSignInLiveData.setValue(new Resource<IdpResponse>(task.getException())); return; } AuthResult authResult = task.getResult(); saveCredentialsOrFinish(authResult.getUser(), password, outputResponse); } }); }