Skip to content

Commit

Permalink
Don't show sign-in suggestions before picker activity (#1121)
Browse files Browse the repository at this point in the history
  • Loading branch information
SUPERCILEX authored and samtstern committed Jan 23, 2018
1 parent 7e3d057 commit 92cc7ca
Showing 1 changed file with 7 additions and 6 deletions.
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 @@ -121,7 +122,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 @@ -134,19 +135,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

0 comments on commit 92cc7ca

Please sign in to comment.