Revert "Make sure sync() happens in UI thread"
This reverts commit 2cdaa04b0ef7faf02a47ed25215c5b20fa5b219d
Marc, we need to go over this. Lots of things broke once I synced this change down. I could not get the contents of folders, things were resyncing all over the place. Reverting this for now.
diff --git a/src/com/android/mail/browse/ConversationCursor.java b/src/com/android/mail/browse/ConversationCursor.java
index f0a11bc..0fed972 100644
--- a/src/com/android/mail/browse/ConversationCursor.java
+++ b/src/com/android/mail/browse/ConversationCursor.java
@@ -157,6 +157,7 @@
if (sRefreshReady) {
// If we already have a refresh ready, just sync() it
LogUtils.i(TAG, "Create: refreshed cursor ready, sync");
+ sConversationCursor.sync();
} else {
// Position the cursor before the first item (as it would be if new), reset
// the cache, and return as new
@@ -171,7 +172,7 @@
// Set qUri/qProjection these in case they changed
LogUtils.i(TAG, "Create: new query or refresh needed, query/sync");
sRequeryCursor = doQuery(uri, projection);
- sRefreshReady = true;
+ sConversationCursor.sync();
}
return sConversationCursor;
}
diff --git a/src/com/android/mail/ui/ConversationListFragment.java b/src/com/android/mail/ui/ConversationListFragment.java
index 2fe0237..8734ce1 100644
--- a/src/com/android/mail/ui/ConversationListFragment.java
+++ b/src/com/android/mail/ui/ConversationListFragment.java
@@ -521,10 +521,6 @@
@Override
public void onLoadFinished(Loader<ConversationCursor> loader, ConversationCursor data) {
mConversationListCursor = data;
- // Sync if necessary
- if (mConversationListCursor.isRefreshReady()) {
- onRefreshReady();
- }
mListAdapter.swapCursor(mConversationListCursor);
mConversationListCursor.addListener(this);
updateSearchResultHeader(data != null ? data.getCount() : 0);