Save HostAuth's when returning from editing Incoming/Outgoing settings
* in onActivityResult, we not only need to update the Account, but also the relevant HostAuth (both if coming from AccountSetupExchange) Change-Id: I0657ff257fe949e46e100eb3e6cfec6162514aa9
This commit is contained in:
parent
cf19af4c74
commit
b19bc4c0b6
@ -267,10 +267,13 @@ public class AccountSetupExchange extends Activity implements OnClickListener,
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
if (Intent.ACTION_EDIT.equals(getIntent().getAction())) {
|
||||
// TODO Review carefully to make sure this is bulletproof
|
||||
if (mAccount.isSaved()) {
|
||||
// Account.update will NOT save the HostAuth's
|
||||
mAccount.update(this, mAccount.toContentValues());
|
||||
mAccount.mHostAuthRecv.update(this, mAccount.mHostAuthRecv.toContentValues());
|
||||
mAccount.mHostAuthSend.update(this, mAccount.mHostAuthSend.toContentValues());
|
||||
} else {
|
||||
// Account.save will save the HostAuth's
|
||||
mAccount.save(this);
|
||||
}
|
||||
finish();
|
||||
|
@ -325,9 +325,9 @@ public class AccountSetupIncoming extends Activity implements OnClickListener {
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
if (Intent.ACTION_EDIT.equals(getIntent().getAction())) {
|
||||
// TODO Review carefully to make sure this is bulletproof
|
||||
if (mAccount.isSaved()) {
|
||||
mAccount.update(this, mAccount.toContentValues());
|
||||
mAccount.mHostAuthRecv.update(this, mAccount.mHostAuthRecv.toContentValues());
|
||||
} else {
|
||||
mAccount.save(this);
|
||||
}
|
||||
|
@ -245,10 +245,10 @@ public class AccountSetupOutgoing extends Activity implements OnClickListener,
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
if (Intent.ACTION_EDIT.equals(getIntent().getAction())) {
|
||||
// TODO Review carefully to make sure this is bulletproof
|
||||
if (mAccount.isSaved()) {
|
||||
mAccount.update(this, mAccount.toContentValues());
|
||||
} else {
|
||||
mAccount.mHostAuthSend.update(this, mAccount.mHostAuthSend.toContentValues());
|
||||
} else {
|
||||
mAccount.save(this);
|
||||
}
|
||||
finish();
|
||||
|
Loading…
Reference in New Issue
Block a user