Merge "Be careful before setting account's delete policy"

This commit is contained in:
Marc Blank 2011-08-26 18:43:34 -07:00 committed by Android (Google) Code Review
commit 9bcdd58a09

View File

@ -433,8 +433,12 @@ public class AccountSetupIncomingFragment extends AccountServerBaseFragment {
public void onNext() {
Account account = SetupData.getAccount();
account.setDeletePolicy(
(Integer) ((SpinnerOption) mDeletePolicyView.getSelectedItem()).value);
// Make sure delete policy is an valid option before using it; otherwise, the results are
// indeterminate, I suspect...
if (mDeletePolicyView.getVisibility() == View.VISIBLE) {
account.setDeletePolicy(
(Integer) ((SpinnerOption) mDeletePolicyView.getSelectedItem()).value);
}
HostAuth recvAuth = account.getOrCreateHostAuthRecv(mContext);
String userName = mUsernameView.getText().toString().trim();