Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.google.android.gms.auth.api.credentials.CredentialRequestResponse;
import com.google.android.gms.auth.api.credentials.CredentialsClient;
import com.google.android.gms.auth.api.credentials.IdentityProviders;
import com.google.android.gms.common.api.CommonStatusCodes;
import com.google.android.gms.common.api.ResolvableApiException;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
Expand Down Expand Up @@ -109,7 +110,7 @@ public void onCreate(Bundle savedInstance) {
}

@Override
public void onSaveInstanceState(Bundle outState) {
public void onSaveInstanceState(@NonNull Bundle outState) {
// It doesn't matter what we put here, we just don't want outState to be empty
outState.putBoolean(ExtraConstants.HAS_EXISTING_INSTANCE, true);
super.onSaveInstanceState(outState);
Expand All @@ -122,19 +123,19 @@ public void onComplete(@NonNull Task<CredentialRequestResponse> task) {
// Auto sign-in success
handleCredential(task.getResult().getCredential());
return;
} else {
if (task.getException() instanceof ResolvableApiException) {
ResolvableApiException rae = (ResolvableApiException) task.getException();
} else if (task.getException() instanceof ResolvableApiException) {
ResolvableApiException rae = (ResolvableApiException) task.getException();
if (rae.getStatusCode() == CommonStatusCodes.RESOLUTION_REQUIRED) {
try {
startIntentSenderForResult(rae.getResolution().getIntentSender(),
RC_CREDENTIALS_READ);
return;
} catch (IntentSender.SendIntentException e) {
Log.e(TAG, "Failed to send Credentials intent.", e);
}
} else {
Log.e(TAG, "Non-resolvable exception:\n" + task.getException());
}
} else {
Log.e(TAG, "Non-resolvable exception:\n" + task.getException());
}
startAuthMethodChoice();
}
Expand Down