Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Run formatter and fix some compilation errors
  • Loading branch information
tvolkert committed Jan 25, 2023
commit 82a3823f69d33c419e44816902c28d4502b27d92
Original file line number Diff line number Diff line change
Expand Up @@ -540,18 +540,18 @@ private void onSignInAccount(GoogleSignInAccount account) {
private String errorCodeForStatus(int statusCode) {
switch (statusCode) {
case GoogleSignInStatusCodes.SIGN_IN_CANCELLED:
return ERROR_REASON_SIGN_IN_CANCELED;
return ERROR_REASON_SIGN_IN_CANCELED;
case CommonStatusCodes.SIGN_IN_REQUIRED:
return ERROR_REASON_SIGN_IN_REQUIRED;
return ERROR_REASON_SIGN_IN_REQUIRED;
case CommonStatusCodes.NETWORK_ERROR:
return ERROR_REASON_NETWORK_ERROR;
return ERROR_REASON_NETWORK_ERROR;
case GoogleSignInStatusCodes.SIGN_IN_CURRENTLY_IN_PROGRESS:
case GoogleSignInStatusCodes.SIGN_IN_FAILED:
case CommonStatusCodes.INVALID_ACCOUNT:
case CommonStatusCodes.INTERNAL_ERROR:
return ERROR_REASON_SIGN_IN_FAILED;
return ERROR_REASON_SIGN_IN_FAILED;
default:
return ERROR_REASON_SIGN_IN_FAILED;
return ERROR_REASON_SIGN_IN_FAILED;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.google.android.gms.auth.api.signin.GoogleSignInClient;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.common.api.ApiException;
import com.google.android.gms.common.api.CommonStatusCodes;
import com.google.android.gms.common.api.Scope;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.tasks.Task;
Expand Down Expand Up @@ -214,13 +215,13 @@ public void signInSilentlyThatImmediatelyCompletesWithoutResultFinishesWithError
MethodCall methodCall = buildInitMethodCall(clientId, null);
initAndAssertServerClientId(methodCall, clientId);

ApiException exception = new ApiException(new Status(CommonStatusCodes.SIGN_IN_REQUIRED, "Error text"));
ApiException exception =
new ApiException(new Status(CommonStatusCodes.SIGN_IN_REQUIRED, "Error text"));
when(mockClient.silentSignIn()).thenReturn(mockSignInTask);
when(mockSignInTask.isComplete()).thenReturn(true);
when(mockSignInTask.getResult(ApiException.class)).thenThrow(exception);

MethodCall methodCall = new MethodCall("signInSilently", null);
plugin.onMethodCall(methodCall, result);
plugin.onMethodCall(new MethodCall("signInSilently", null), result);
verify(result).error("sign_in_required", "Error text", null);
}

Expand Down