Merge change I74466dcc into eclair

* changes:
  Update unread counts and default sender Id in AccountFolderList after folder loding messages
This commit is contained in:
Android (Google) Code Review 2009-09-29 00:35:05 -04:00
commit b0b61fa2e4

View File

@ -213,12 +213,7 @@ public class AccountFolderList extends ListActivity
Controller.getInstance(getApplication()).addResultCallback(mControllerCallback); Controller.getInstance(getApplication()).addResultCallback(mControllerCallback);
if (mLoadAccountsTask != null && updateAccounts();
mLoadAccountsTask.getStatus() != LoadAccountsTask.Status.FINISHED) {
mLoadAccountsTask.cancel(true);
}
mLoadAccountsTask = (LoadAccountsTask) new LoadAccountsTask().execute();
// TODO: What updates do we need to auto-trigger, now that we have mailboxes in view? // TODO: What updates do we need to auto-trigger, now that we have mailboxes in view?
} }
@ -364,6 +359,14 @@ public class AccountFolderList extends ListActivity
} }
} }
private void updateAccounts() {
if (mLoadAccountsTask != null &&
mLoadAccountsTask.getStatus() != LoadAccountsTask.Status.FINISHED) {
mLoadAccountsTask.cancel(true);
}
mLoadAccountsTask = (LoadAccountsTask) new LoadAccountsTask().execute();
}
private void onAddNewAccount() { private void onAddNewAccount() {
AccountSetupBasics.actionNewAccount(this); AccountSetupBasics.actionNewAccount(this);
} }
@ -446,6 +449,8 @@ public class AccountFolderList extends ListActivity
AccountSetupBasics.actionNewAccount(AccountFolderList.this); AccountSetupBasics.actionNewAccount(AccountFolderList.this);
finish(); finish();
} }
// Update unread counts and the default sender Id
updateAccounts();
} }
}) })
.setNegativeButton(R.string.cancel_action, new DialogInterface.OnClickListener() { .setNegativeButton(R.string.cancel_action, new DialogInterface.OnClickListener() {
@ -619,6 +624,9 @@ public class AccountFolderList extends ListActivity
if (result != null || progress == 100) { if (result != null || progress == 100) {
Email.updateMailboxRefreshTime(mailboxKey); Email.updateMailboxRefreshTime(mailboxKey);
} }
if (progress == 100) {
updateAccounts();
}
updateProgress(result, progress); updateProgress(result, progress);
} }