am 64bbe34d: am 12866ff1: am 0f3a01a4: am 14286249: am d716d894: Don\'t assume mHostAuthRecv is loaded when checking outgoing

* commit '64bbe34de96b5b4d63e33c08a8484f7946460b5c':
  Don't assume mHostAuthRecv is loaded when checking outgoing
This commit is contained in:
Tony Mantler 2014-11-02 19:03:19 +00:00 committed by Android Git Automerger
commit 86e9a92c87

View File

@ -314,8 +314,8 @@ public class AccountCheckSettingsFragment extends Fragment {
final SetupDataFragment mSetupData; final SetupDataFragment mSetupData;
final Account mAccount; final Account mAccount;
final String mStoreHost; final String mStoreHost;
final String mCheckEmail;
final String mCheckPassword; final String mCheckPassword;
final String mCheckEmail;
/** /**
* Create task and parameterize it * Create task and parameterize it
@ -330,9 +330,14 @@ public class AccountCheckSettingsFragment extends Fragment {
mMode = mode; mMode = mode;
mSetupData = setupData; mSetupData = setupData;
mAccount = setupData.getAccount(); mAccount = setupData.getAccount();
if (mAccount.mHostAuthRecv != null) {
mStoreHost = mAccount.mHostAuthRecv.mAddress; mStoreHost = mAccount.mHostAuthRecv.mAddress;
mCheckEmail = mAccount.mEmailAddress;
mCheckPassword = mAccount.mHostAuthRecv.mPassword; mCheckPassword = mAccount.mHostAuthRecv.mPassword;
} else {
mStoreHost = null;
mCheckPassword = null;
}
mCheckEmail = mAccount.mEmailAddress;
} }
@Override @Override
@ -411,11 +416,18 @@ public class AccountCheckSettingsFragment extends Fragment {
} }
} }
final EmailServiceInfo info;
if (mAccount.mHostAuthRecv != null) {
final String protocol = mAccount.mHostAuthRecv.mProtocol; final String protocol = mAccount.mHostAuthRecv.mProtocol;
final EmailServiceInfo info = EmailServiceUtils.getServiceInfo(mContext, protocol); info = EmailServiceUtils
.getServiceInfo(mContext, protocol);
} else {
info = null;
}
// Check Outgoing Settings // Check Outgoing Settings
if (info.usesSmtp && (mMode & SetupDataFragment.CHECK_OUTGOING) != 0) { if ((info == null || info.usesSmtp) &&
(mMode & SetupDataFragment.CHECK_OUTGOING) != 0) {
if (isCancelled()) return null; if (isCancelled()) return null;
LogUtils.d(Logging.LOG_TAG, "Begin check of outgoing email settings"); LogUtils.d(Logging.LOG_TAG, "Begin check of outgoing email settings");
publishProgress(STATE_CHECK_OUTGOING); publishProgress(STATE_CHECK_OUTGOING);