Merge "Add support for disabling OAuth on setup flow only" into ub-mail-master

This commit is contained in:
Tony Mantler 2014-07-30 17:33:30 +00:00 committed by Android (Google) Code Review
commit e495f17a4f
2 changed files with 10 additions and 0 deletions

View File

@ -26,4 +26,8 @@
<!-- Boolean value indicating if quick responses are supported --> <!-- Boolean value indicating if quick responses are supported -->
<bool name="quickresponse_supported">true</bool> <bool name="quickresponse_supported">true</bool>
<!-- Boolean value indicating whether we should show the OAuth option on initial account setup
(not settings) -->
<bool name="skip_oauth_on_setup">false</bool>
</resources> </resources>

View File

@ -186,6 +186,12 @@ public class AccountSetupCredentialsFragment extends AccountSetupFragment
mOfferOAuth = true; 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); mOAuthGroup.setVisibility(mOfferOAuth ? View.VISIBLE : View.GONE);
mRegularPasswordText.setVisibility(mOfferOAuth ? View.GONE : View.VISIBLE); mRegularPasswordText.setVisibility(mOfferOAuth ? View.GONE : View.VISIBLE);