Merge change 8633
* changes: Fix UnsupportedOperationException in AccountSetupBasic caused by Account.update() when !isSaved().
This commit is contained in:
commit
63b2ad5bfb
@ -303,12 +303,11 @@ public class AccountSetupBasics extends Activity
|
|||||||
if (resultCode == RESULT_OK) {
|
if (resultCode == RESULT_OK) {
|
||||||
String email = mAccount.getEmailAddress();
|
String email = mAccount.getEmailAddress();
|
||||||
boolean isDefault = mDefaultView.isChecked();
|
boolean isDefault = mDefaultView.isChecked();
|
||||||
mAccount.setDisplayName(mAccount.getEmailAddress());
|
mAccount.setDisplayName(email);
|
||||||
mAccount.setDefaultAccount(mDefaultView.isChecked());
|
mAccount.setDefaultAccount(isDefault);
|
||||||
ContentValues cv = new ContentValues();
|
// At this point we write the Account object to the DB for the first time.
|
||||||
cv.put(AccountColumns.DISPLAY_NAME, email);
|
// From now on we'll only pass the accountId around.
|
||||||
cv.put(AccountColumns.IS_DEFAULT, isDefault);
|
mAccount.save(this);
|
||||||
mAccount.update(this, cv);
|
|
||||||
Email.setServicesEnabled(this);
|
Email.setServicesEnabled(this);
|
||||||
AccountSetupNames.actionSetNames(this, mAccount.mId);
|
AccountSetupNames.actionSetNames(this, mAccount.mId);
|
||||||
finish();
|
finish();
|
||||||
|
Loading…
Reference in New Issue
Block a user