Add support for disabling OAuth on setup flow only

b/16633826

Change-Id: Iea984ae656fbf3fe44de7598fdb9357a18d52a74
This commit is contained in:
Tony Mantler 2014-07-30 09:55:16 -07:00
parent 7063124d1d
commit e96791403e
2 changed files with 10 additions and 0 deletions

View File

@ -26,4 +26,8 @@
<!-- Boolean value indicating if quick responses are supported -->
<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>

View File

@ -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);