From e96791403e39fa93a73fc285dac537c57ea6ce88 Mon Sep 17 00:00:00 2001 From: Tony Mantler Date: Wed, 30 Jul 2014 09:55:16 -0700 Subject: [PATCH] Add support for disabling OAuth on setup flow only b/16633826 Change-Id: Iea984ae656fbf3fe44de7598fdb9357a18d52a74 --- res/values/constants.xml | 4 ++++ .../activity/setup/AccountSetupCredentialsFragment.java | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/res/values/constants.xml b/res/values/constants.xml index 945d348ff..e25d009ed 100644 --- a/res/values/constants.xml +++ b/res/values/constants.xml @@ -26,4 +26,8 @@ true + + + false \ No newline at end of file diff --git a/src/com/android/email/activity/setup/AccountSetupCredentialsFragment.java b/src/com/android/email/activity/setup/AccountSetupCredentialsFragment.java index 650e98841..dcb824ab1 100644 --- a/src/com/android/email/activity/setup/AccountSetupCredentialsFragment.java +++ b/src/com/android/email/activity/setup/AccountSetupCredentialsFragment.java @@ -186,6 +186,12 @@ public class AccountSetupCredentialsFragment extends AccountSetupFragment mOfferOAuth = true; } } + // We may want to disable OAuth during the new account setup flow, but allow it elsewhere + final boolean standalone = getArguments().getBoolean(EXTRA_STANDALONE); + final boolean skipOAuth = !standalone && + getActivity().getResources().getBoolean(R.bool.skip_oauth_on_setup); + mOfferOAuth = mOfferOAuth && !skipOAuth; + mOAuthGroup.setVisibility(mOfferOAuth ? View.VISIBLE : View.GONE); mRegularPasswordText.setVisibility(mOfferOAuth ? View.GONE : View.VISIBLE);