am b7c67a01: am 754240bc: Fix race condition in testMultiple()

Merge commit 'b7c67a0124fe4897c71f5cbe4bbae87621a6a1fa' into eclair-mr2-plus-aosp

* commit 'b7c67a0124fe4897c71f5cbe4bbae87621a6a1fa':
  Fix race condition in testMultiple()
This commit is contained in:
Andrew Stadler 2009-10-13 12:47:23 -07:00 committed by Android Git Automerger
commit b48b1e9a81

View File

@ -752,6 +752,9 @@ public class MessageList extends ListActivity implements OnItemClickListener, On
*/ */
private boolean testMultiple(Set<Long> selectedSet, int column_id, boolean defaultflag) { private boolean testMultiple(Set<Long> selectedSet, int column_id, boolean defaultflag) {
Cursor c = mListAdapter.getCursor(); Cursor c = mListAdapter.getCursor();
if (c == null || c.isClosed()) {
return false;
}
c.moveToPosition(-1); c.moveToPosition(-1);
while (c.moveToNext()) { while (c.moveToNext()) {
long id = c.getInt(MessageListAdapter.COLUMN_ID); long id = c.getInt(MessageListAdapter.COLUMN_ID);