From 9576dee6ed0eee1eda309bbf45aa949befb5231d Mon Sep 17 00:00:00 2001 From: Alex Saveau Date: Fri, 23 Feb 2018 18:06:04 -0800 Subject: [PATCH 1/2] Don't show hard-to-use IDPs for Smart Lock sign-in Signed-off-by: Alex Saveau --- .../ui/auth/util/signincontainer/SignInDelegate.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java b/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java index afc9280fe..d68e5a45c 100644 --- a/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java +++ b/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java @@ -39,12 +39,10 @@ import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.EmailAuthProvider; -import com.google.firebase.auth.FacebookAuthProvider; import com.google.firebase.auth.FirebaseAuthInvalidCredentialsException; import com.google.firebase.auth.FirebaseAuthInvalidUserException; import com.google.firebase.auth.GoogleAuthProvider; import com.google.firebase.auth.PhoneAuthProvider; -import com.google.firebase.auth.TwitterAuthProvider; import java.util.ArrayList; import java.util.List; @@ -224,9 +222,7 @@ private List getSupportedAccountTypes() { List accounts = new ArrayList<>(); for (AuthUI.IdpConfig idpConfig : getFlowParams().providerInfo) { @AuthUI.SupportedProvider String providerId = idpConfig.getProviderId(); - if (providerId.equals(GoogleAuthProvider.PROVIDER_ID) - || providerId.equals(FacebookAuthProvider.PROVIDER_ID) - || providerId.equals(TwitterAuthProvider.PROVIDER_ID)) { + if (providerId.equals(GoogleAuthProvider.PROVIDER_ID)) { accounts.add(ProviderUtils.providerIdToAccountType(providerId)); } } From 68ae0c00c6f6db3cc146c227991d1a9152c26618 Mon Sep 17 00:00:00 2001 From: Alex Saveau Date: Mon, 26 Feb 2018 11:02:30 -0800 Subject: [PATCH 2/2] Rename method Signed-off-by: Alex Saveau --- .../firebase/ui/auth/util/signincontainer/SignInDelegate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java b/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java index d68e5a45c..cd43dbff4 100644 --- a/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java +++ b/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java @@ -109,7 +109,7 @@ public void onCreate(Bundle savedInstance) { supportPasswords = true; } } - List accountTypes = getSupportedAccountTypes(); + List accountTypes = getCredentialAccountTypes(); // If the request will be empty, avoid the step entirely boolean willRequestCredentials = supportPasswords || accountTypes.size() > 0; @@ -218,7 +218,7 @@ public void finish(int resultCode, Intent resultIntent) { } } - private List getSupportedAccountTypes() { + private List getCredentialAccountTypes() { List accounts = new ArrayList<>(); for (AuthUI.IdpConfig idpConfig : getFlowParams().providerInfo) { @AuthUI.SupportedProvider String providerId = idpConfig.getProviderId();