History log of /packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
bb6b28214b48ef0d74769c35bdc73979e379c401 10-Apr-2015 Jeff Brown <jeffbrown@google.com> Implement missing Cursor.setExtras method.

Bug: 19369537
Change-Id: I02f35d5010c5393a5c8082f2260e3fe2934815b7
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
ee6766a2c6938dbb4c975d93732d7033eecd90a5 06-Aug-2014 Jin Cao <jinyan@google.com> Properly check CursorStatus.ERROR

ConversationCursor is considered to be ready to show
if the status is error (e.g. no connection).

Move the check for adapter's count to after we try
to show footer based on the cursor status.

b/16739103

Change-Id: Ia94672710ce46d4b8035a0f8eba7e0827d453b3d
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
512821c11d89d49908f3cfdee0b582601f500f3d 31-May-2014 Jin Cao <jinyan@google.com> Support "deleting" in outbox

- Allow only failed items in Outbox to be swiped away/deleted.
- Same applies for multi-selection.
- "Deleting" in Outbox means remove the outbox label from the
failed message and applying the drafts label. This needs to
be implemented by both Gmail and Email providers.
- Added new ConversationOperation for this new action.

b/4080109

Change-Id: Ia9c8e386c7c65693f72fda85a49cb6a1b7d1fec1
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
b0b9e69c68f48b45b8bf840d84d79cd3ca794f95 13-Jun-2014 Jin Cao <jinyan@google.com> Fixed conditional for checking if cursor is ready

Because the cursor can be mutated by user input, we should deem
the cursor to be ready to show if it either has a count of 0 or
it has a COMPLETE state. Prior we were checking if it's not in
LOADING state, which can be wrong if the cursor is partially
loaded but the user removed all of the loaded conversations. In
that case, the cursor's size would be 0 but the state would be
LOADED, and it would wrongly show the empty state.

b/15583795

Change-Id: I7c953a477922d10c027e40b19e8fe83a09b968e4
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
bc29ed3a5fe96ac144d5157150551febfb4d1355 08-May-2014 Jin Cao <jinyan@google.com> Take adapter's teasers/footers into account when showing empty view

Avoid showing anything until the cursor is partially/fully loaded.
Once the cursor is loaded, use mAdapter.getCount instead of
cursor.getCount to check for list count since mAdapter might have
special views that it wants to show despite the empty list.

b/14651214
Change-Id: Ife9de623110adbd191991fd9d8746f9ce93fbf5f
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
f21787ad2ac7d68e3620ffa3ae6e8e7fadf0bd54 02-May-2014 Andy Huang <ath@google.com> allow the user to recover from stuck-cursor issues

Treat swipe-refresh as a trigger to clear stale adapter state that may
prevent normal cursor refresh from happening. While it's important to
delay cursor refresh until animations are complete (to prevent jank),
there was previously no way to get out of buggy states where the adapter
though an animation was happening but never did.

Bug: 14297883
Change-Id: I0d279770246e93c939b589cd0ac5eba76358b47e
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
30c881a7d31203fc7b233abf4a0c1413de4cd517 08-Apr-2014 Jin Cao <jinyan@google.com> DO NOT MERGE Added support for arbitrary post-undo actions

- Added interface to add arbitrary callbacks after a specific undo
action occurred. This is useful if we want to do some specific UI
modification after an undo, show the user more information, etc.
- This callback is also added to DestructiveAction so all destructive
actions can run custom callback when it's undone.
- Used the interface to add show the removed conversation when auto
advance is active.
- Removed references of inLoaderCallbacks in AbstractActivityController
where it's not being used.

Demo video here:
https://drive.google.com/a/google.com/file/d/0ByX6TliQlkICSjZub0ZyaWtxS0pmZk1kbk5WQ2V5SGlMTWxF/edit?usp=sharing

b/6769311

Change-Id: I00cc66421315091cc934e0f63188ff693b0a84b8
(cherry picked from commit f55863727de2bb15f1906944bbc88c82703a3aff)
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
5bb4d053519be10324752f323bcf73f13b9a2604 01-Apr-2014 Andrew Sapperstein <asapperstein@google.com> Allowing overriding conversation list load limit.

b/7280077

One issue we saw was that if the conversation was not
in the initial 50 conversations, we would get punted
out of the conversation list. Now we have an additional
extra in ACTION_VIEW intents that allow ignoring the
limit for the first load of the ConversationCursor.

Change-Id: I737c45e122df4dda7c63794ddc7036be61d5ebd4
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
0423e2fcde33668e238d550594ebc17853d52a68 06-Nov-2013 Alon Albert <aalbert@google.com> Fix build

ur11 already has getNotificationUri()


Change-Id: Iffb22e2542470c28e30b41b7a619efa736a00822
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
ea4b10af8cb96db95fa35d6c70bf4588ca044567 06-Nov-2013 Alon Albert <aalbert@google.com> am 2a8a3d85: Merge "Implement Cursor.getNotificationUri" into jb-ub-mail-ur10

* commit '2a8a3d85d9b199492611e009f370d0fc9d81c88f':
Implement Cursor.getNotificationUri
d114baceac4106d19de6818492e076470c7938b9 05-Nov-2013 Alon Albert <aalbert@google.com> Implement Cursor.getNotificationUri

Due to SDK Version 19

Bug: 11533662
Change-Id: I9237c593d4231cd8319c4e64f4a4e4c5fb16176b
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
3d5ea425bce684d8fdd0a51f055025a663f3dc2e 12-Sep-2013 Alice Yang <alice@google.com> Disable features for Svelte

Disable following features for svelte (low memory devices):
- Sender images in conversation list always off and hidden in settings
- Attachment previews in conversation list always off and hidden in settings
- Auto-download attachments over wifi default to false, but still show in settings
- Conversation cursor precaching

Bug 10708266, 9325806, 9325758

Change-Id: I9d6ed9414467041f77c2895de7a71040b9a8b32a
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
51debf6562400a533ad9b0a5e56d9f60d0d3b9e3 10-Sep-2013 Tony Mantler <nicoya@google.com> am ec5b82ac: Fix string comparison to use .equals()

* commit 'ec5b82ac3fc8f914fa1efdeff36ea3dc4e55b3e3':
Fix string comparison to use .equals()
ec5b82ac3fc8f914fa1efdeff36ea3dc4e55b3e3 10-Sep-2013 Tony Mantler <nicoya@google.com> Fix string comparison to use .equals()

Change-Id: I4b0fddd06c74f9803f85f3bff019d48e1e1e4695
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
adf9fcb5239d9194d52b5a4a554b6679cb2b31f5 29-Aug-2013 Alice Yang <alice@google.com> Fix build.

A new getNotificationUri() method was added to Cursor.java in KLP.

Change-Id: Ic9a2ad14da9111bc729ccc118a7c30d8649f6991
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
cef97ff7118b0a30cff842129300e0633d220043 22-Aug-2013 Andy Huang <ath@google.com> avoid constructing inner URIs in common cases

Bug: 10442911
Change-Id: I15d73b54181dafee98dd5aa503822b4230089402
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
b26f5c755741b83417ddf302f2d0dee7d39c1b74 22-Aug-2013 Scott Kennedy <skennedy@google.com> Use the same key for put and get

We were using different keys for adding cached values then for using
those values to update conversations, so local changes were never
being applied.

Bug: 10391532
Change-Id: I285b002719851d3bcef6c5209c4510e783e7394c
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
a3526f6b1f59cc6b83aa6634d6f11e22bdb22edb 16-Jul-2013 Paul Westbrook <pwestbro@google.com> Fix NPE with null cursor

Bug: 9623875
Change-Id: I03ee4e3b1f401853cec8a2bc6f02d14b70c6d4ce
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
c3ccebce4a82e103ce7cae618166ca435c9969a0 10-Jul-2013 Alice Yang <alice@google.com> Fix stale conversation list after undo.

After performing an UNDO operation, mDeferSync was not being reset to false,
which means any updates to underlying conversation cursor (such as new mail
arriving) were being ignored and not reflected in the UI.

Bug 8332559

Change-Id: Ia2e4696bc0dc15e9faee03c9dd1d2d3b1feed989
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
ba73fdddc4e85ef810a7b8d3aa6449656c44a317 09-Jul-2013 Alice Yang <alice@google.com> Fix NPE in ConversationItemView

Bug 9754211

Change-Id: I1b201103f24001be1e3ccf4b8d4791d7613e344e
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
c4e230fd260e8d80cffc0515bb9322f7553853f9 28-Jun-2013 Andy Huang <ath@google.com> list caching tweaks

* stop background caching earlier - it's pointless to continue caching
when the dataset changes and a new cursor is inbound. avoids creating
unnecessary garbage.
* add explicit GCs to sidestep common cases that usually result in
GC_FOR_ALLOC: after a query and after background caching

Bug: 9032162
Change-Id: Ic2e7819e6887b965515a63db3cac7e4dfdf70969
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
144bfe739b93afdee0a1700a34806b0b287e5887 11-Jun-2013 Andy Huang <ath@google.com> yielding cache construction to reduce scroll+refresh jank

Background caching of conversation objects triggers GC_FOR_ALLOC, which
blocks the main thread and causes jank. We do want to cache to improve
scroll framerate, but we also want to avoid causing GCs while drawing is
in progress.

Add cancel-handling to the cache's async task, and connect it to a new
DrawIdler class that monitors a view hierarchy for draws. Together, they
cause any drawing to pause background caching until 100ms of drawing
silence.

If you scroll before the cache is filled, scroll framerate will not
benefit from the cache, so it will be somewhat lower. Previously,
caching would continue during the scroll, so depending on where you are
in the list, it may have been faster, except that it was punctuated by
annoying GC pauses. The framerate now will be generally more even now,
although it may be lower if you scroll before the cache is allowed to be
filled.

The DrawIdler is 1:1 owned by the Activity/Controller, but a single
Cursor may be shared across Activity instances (e.g. rotate). So connect
each DrawIdler to the shared cursor in onLoadFinished. This works
because the rotated Activity's onLoadFinished is called *after* the
first Activity's onDestroy.

Bug: 9032162
Change-Id: I217dac012f2d74f47a158aee3bd2de78d9b14171
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
3b965d78774a42358ce6bbdcc43b4c8df130a60e 25-Jun-2013 Scott Kennedy <skennedy@google.com> Clean up a bunch of warnings

Bug: 9565838
Change-Id: Ie3a380581e81c63aaa0764875c55bfdccd5f2b13
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
47cd4c3b064da3aac82e4ca1a057fd51c4ebad77 19-Jun-2013 Andy Huang <ath@google.com> put UnderlyingCursorWrapper on a diet

'wrappedUri' was basically unused; having the cursor wrap URIs on demand
appears to be an old codepath we no longer depend on. All instances
where the wrappedUri is later used check the URI authority and handle non-
ConversationCursor authorities just fine.

Use the more basic UnmodifiableMap over ImmutableMap to save 10ms of
build() time and some garbage. Will still throw an exception upon
duplicate key condition if DEBUG_DUPLICATE_KEYS is true, otherwise will
log.

Bug: 9032162
Change-Id: I9851ff6b2cea9472ebbb157c35eb407c7ba8ffb3
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
9cf625efcbc9c7eccce8101e12c9e2d33d52672b 15-Jun-2013 Andy Huang <ath@google.com> reduce pre-caching garbage

Reuse a StringBuilder for all rows when pre-caching URIs.

Change-Id: I6a00b6596e4c4c6e131d07a54063730711019697
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
43d2cb188e586d84db0db1da3241a615185c7d12 12-Jun-2013 Andy Huang <ath@google.com> add systrace logging

Change-Id: Iabe0f7b2d81c4fa06f8d341c20274e34fa34eb08
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
00839ad20f1e8a39fa781571d33aade92f808d82 06-Jun-2013 Scott Kennedy <skennedy@google.com> Merge "Unify LogTag" into jb-ub-mail-ur10
4fcac283dfba95f1a89c1ea9c3c5240560378b94 06-Jun-2013 Paul Westbrook <pwestbro@google.com> Enable debugging for duplicate conversation keys

Bug: 9294348
Change-Id: Ib089f62ad08a54297eed9548f8f89c75278a81db
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
b184bfe96fa3512af88260fce4f3cee3066fb28d 26-May-2013 Scott Kennedy <skennedy@google.com> Unify LogTag

There is now only one LogTag class. The static initializer of
GmailApplication (existing) and EmailApplication (new) will now set
the log tag to "Gmail" and "Email", respectively. Up until that code
is run, it will be "UnifiedEmail".

"setprop log.tag.Gmail VERBOSE" (or .Email) will trigger all logs to
be printed as long as they go through LogUtils, regardless of what tag
is used by that individual log. This lets us still turn on logging
everywhere in one command, but also lets us use more descriptive tags
(like the class name).

And since we no longer have three com.android.mail.utils.LogTag
classes, builds will be much easier.

Also, we now use LogUtils everywhere.

Change-Id: Iec53e87cad0a46b73d2afbbd8d44aca097a5087a
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
f8b613c1103952ae5cc1f8a5e6ae60aa62d73dec 25-May-2013 Andy Huang <ath@google.com> patch up respond() results with cache contents (the easy way)

Bug: 9112331
Change-Id: I9688f272d82c760b118822dd5d4485c975b5090f
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
6cf45c601317d4b65ffb1896760fa1cb8a2b807c 24-May-2013 Andy Huang <ath@google.com> fix itemId lookup in edge cases

The last optimization to use the cache in itemId lookup had two
problems:
* CursorAdapter.mDataValid wasn't checked before lookup
* didn't translate ConversationCursor position to underlying cursor
position

Removed getConversationAt() since it's not safe for a ConversationCursor
position to be used on the underlying cursor. Any access has to go first
through moveToPosition to handle deleted rows.

Bad positions passed to getItemId() will now fail earlier and more
gracefully upon position change.

Bug: 9111205
Change-Id: I9242bf4fe841bee4f91146bd4896bb01e1cbdea7
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
3663453628ab545bcba3327d972eecac72b6c2d0 23-May-2013 Andy Huang <ath@google.com> avoid URI<->String conversions

Don't generate URI objects just to splice in our caching provider's
authority. We end up using them as Strings anyway, just stick with
Strings. indexOf('://') is way faster than parsing an entire URI.

Bug: 9032162
Change-Id: I985ef38db46441996219180ba2a1ef658c080322
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
55e76949ca7464c3bd55fdc25fb3daa43466ef5c 23-May-2013 Andy Huang <ath@google.com> minimize an unnecessary critical section on the UI thread

Adapter.getItemId was blocking on the cursor-advancing lock in
ThreadSafeCursorWrapper, occasionally causing the UI thread to block on
the background CacheLoaderTask.

Changed getItemId to use the Conversation cache when feasible.

Bug: 9032162
Change-Id: I19f00ceefeb52e580b1e3311c6625a4f034f0402
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
983a723931447b6261a2e42b25e6f931dba6de33 15-May-2013 Paul Westbrook <pwestbro@google.com> Use the explcit provider notification

Use the new provider notification to explictly tell the provider
that the user is viewing an item in the conversation cursor.

This prevents side effects from just iterating over the result set

Bug: 8961122

Change-Id: Ie1fd0daf2909e13d331f9fe609d0daedab607196
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
c1922a93fb9540d4ff8c28a30d1ae58d3a3d73f9 13-May-2013 Andy Huang <ath@google.com> Fix undo when auto-advance is not set to 'list'

Auto-advance broke undo because undo did a sequence number check before
doing anything, and a side effect of auto-advance is to mark the next
conversation read!

Added more toString() logging to assist improve 'dumpsys activity'
output.

Bug: 8877688
Change-Id: I54597c4511780651a3a043a7752191cbad6fa1b9
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
a0214391331f3248569b74788639b491732e6427 16-May-2013 Andy Huang <ath@google.com> Fix underlying change processing during reset

If underlyingChanged is called in resetCursor(), the Controller will
call refresh(), and that does nothing if a refresh task is present. It
turns out that the refresh task is expected to be present but inert in
resetCursor(), so ensure that it is nulled out BEFORE resetCursor().
This also better matches the calling order pattern in setCursor().

Fixing this fixes some cases where mRefreshRequired was stuck at true,
preventing new/more mail from appearing.

Bug: 8961122
Change-Id: I6696cfe5d7d1a612379ff2a3c11069f754807ab2
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
26ee0eac7e362b8eba9e0932360f8e76bd64d099 15-May-2013 Andy Huang <ath@google.com> disable network access on background conversation loader

Background cursor traversal was triggering live fetch of conversations.
This is not particularly safe if the user manages to scroll past the
background task's position and expects that live conversations will
load.
But this is better for now.

Bug: 8971881
Change-Id: Ia063200259e621a493e0d0136cb2709beeac0806
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
2ed31f4c45316b65af0e4db02e76366b58d66768 15-May-2013 Paul Westbrook <pwestbro@google.com> Catch potentially missed update

If an update to a cursor happens before the call resetCursor()
any provider change wouldn't trigger a refresh

Bug: 8961122
Change-Id: I10b7e959bee2f845f3432bf8e84bb1ff1ed114e4
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
1892261a7dfa66b1c967ede0842a0cb2802f4187 14-May-2013 Paul Westbrook <pwestbro@google.com> Don't drop notifications

If onChange() of the ConversationCursor's CursorObserver is called
before the AbstractActivityController has had a chance to register
a listener, nothing would call
ConversationCursor#notifyRefreshRequired(). This would cause:
1) No content observer registered on the underlying cursor, so no
other provider changes would get propegated to the UI
2) The cursor would be in the "refresh required" state, but until
the next resume, nothing would trigger the refresh

Now, when the first listener is registered, if the cursor is in the
"Refresh required" state, ConversationCursor#notifyRefreshRequired() will
be called

Bug: 8961122
Change-Id: Iec16c9b8e69b66bbef833ee38252b7f1798de716
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
6de11b098c86f45a3c21dd59b548da91cb736892 11-May-2013 Paul Westbrook <pwestbro@google.com> Allow ConversationCursor to be populated in background

Added a "thread safe" cursor wrapper, which can allow a cursor
to be used by multiple threads

The constructor for UnderlyingCursorWrapper will load 100
conversations. If the there are more rows, an AsyncTask will
be started to load the remainder

Bug: 8642220

Change-Id: I665b7a57d3264b6347e5d8bc8588629e320d8382
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
315bd43f773b924e63689e993d9473d0f4b7f055 11-May-2013 Paul Westbrook <pwestbro@google.com> Disable duplicate key debugging code

Change-Id: I7c88025c111d51f60e25a9eb36cad98267513e95
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
828bc86ffcb1274fb461fbb25cdc2a07ae76b6c8 25-Apr-2013 Andrew Sapperstein <asapperstein@google.com> Run handle/resetNotificationActions on UI thread.

Fixes b/8703644 by making the bodies of
handleNotificationActions and resetNotificationActions
post onto the UI thread for all of their work and thus
fixes the ConcurrentModificationException of
mNotificationTempDeleted. Also fixes b/8608274
because cacheValue is no longer being called
on a non-UI thread in these two functions.

Also contains a partial fix for notification
actions being undone while the conversation
view pager was open. Now we only update the
ConversationCursor's internal state when the
undo notification is tapped rather than whenever
it is dismissed.

Change-Id: I937dd7f7a0f7284a6f66b982fe363a63c3618f3f
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
3d39350e5b6c8e6841f4ec40d1fa6cabaf70bd4f 19-Apr-2013 Paul Westbrook <pwestbro@google.com> Add logging for duplicate map key problem

Bug: 8460177
Change-Id: I5f303769cdef0eda995401995934be9bf8efce52
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
7ee089ea2ef96e31504e88637b5f3b0969b3c7c1 25-Mar-2013 Scott Kennedy <skennedy@google.com> Add Empty trash/spam option

Bug: 4559378
Change-Id: I8dc5715a5f14f9fd6e8962ab665c4c25f3c64302
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
2992aa3cac250355c41bc6f3b4dd77b0ce4f1e1b 17-Apr-2013 Andy Huang <ath@google.com> log more in ConversationCursor

Bug: 8553051
Change-Id: I14f92119b7c66f5e0f3bc3f995b4b1595b1fcccb
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
e5ca52d91ee8482a81abbd80d625ef592db6fa8d 26-Mar-2013 Yu Ping Hu <yph@google.com> Fix UI updating on undo.

The UI assumed that the conversations being undeleted were
still in the cursor and behaved badly if the original
deletion had already been written through and reloaded into
the cursor.

Bug: 8373349
Change-Id: I8c05cb6b6694fed5579cad3d48afd8d6931b36f3
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
0be9243458fc713bc34b3ab76bfb0529f7e67871 23-Mar-2013 Andy Huang <ath@google.com> small fixes to play better with Gmail's conversation cursor logic

Prevent NotificationUtils's unseen count checking from affecting any
active network cursor. This was stealing cursor focus away from a
visible live label, causing the list to refresh and go blank (due to a
missing spinner in b/8457387).

Make sure that the ConversationCursor's pre-caching disables network
access before it even tries to move to the first row. This was
unnecessarily causing fetcher thread logic to run (although no fetcher
thread was made).

Bug: 8459867
Change-Id: Id4e6a0529d5e888ef5b843816101caa7ae85f984
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
40ada66d5dc6a0d5ad02f4a319acc03d126e9fc9 22-Mar-2013 Scott Kennedy <skennedy@google.com> Remove a bunch of unused methods

Change-Id: I9c7fa70d42335694fc6ae9d9acc3955a922c96d7
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
9e2d407fdafeb874e640eb84017feaf784309075 22-Mar-2013 Scott Kennedy <skennedy@google.com> Clean up a bunch of warnings

Change-Id: I5c75564eeb2df9ec76d682dbe5f4465ff2a1a5d4
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
b1e21487e18503cc110e1cf8726b835e048ab1c1 15-Mar-2013 Scott Kennedy <skennedy@google.com> Mark messages seen when we view a conversation list

Mark the contents of a ConversationCursor seen, when we view that
conversation list. This may not be supported by the provider.

Change-Id: I38f0027dd22a372f05f93a11b40a9e2cf96d4455
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
1bca265b7a8a3f9ea08e0ae51eeb145f0883a266 12-Dec-2012 Andy Huang <ath@google.com> aggressive pre-caching of Conversations

In the spirit of eliminating all unnecessary work on the UI
thread during scrolling, pre-load all Conversation objects
in a cursor in the Loader thread.

Although it's slow to process all such conversations at once,
the impact on initial load time of the conversation list is
minimal because we always load a small (n=50) conversation list
first.

Now the only work done during scrolling is layout-related, some
of which can also reasonably be pre-cached.

Bug: 7690709
Change-Id: I910f85f9b6830f9b059379da9f16a19dc3e6036a
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
81230ee24b65099109ee91add5a137d3795c454a 27-Feb-2013 Vikram Aggarwal <viki@google.com> Add logging to debug mark unread

Also, log problems with not finding the CLF only on tablets, where we
expect the CLF.

And only exit detached mode if we were in detached mode.

Bug: 7326925 Mark Unread Non-Functional When Viewing Message

Change-Id: I9eb8d8ac28f7c95c5c865f1051c5ed0baa066ec4
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
cb85aeaf327e2c6a326457b5a395b4d6cdb70d63 25-Feb-2013 Scott Kennedy <skennedy@google.com> Fix crashes related to the notification undo listener

There were some issues with registering and unregistering the
DataSetObserver from Ib88a14142238b5553f80d59e67be5f64ab2a28fb.

This moves the observer to the AbstractActivityController, allowing
its registration to be tied to the Activity's lifecycle.

Bug: 8262838
Change-Id: I388bb54b01a6cb16df6104297791076dae120e4e
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
08a079c3d2857e365736432b2691187767eb116f 22-Feb-2013 Scott Kennedy <skennedy@google.com> Hide conversations from list after removal via notif action

If a conversation is archived, deleted, or has a label removed via a
notification action, we should hide it from the conversation list
until either the undo notification is activated, or it times out.

Bug: 8248145
Change-Id: Ib88a14142238b5553f80d59e67be5f64ab2a28fb
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
d6020119c71ef9fe38725d0f0291cac7b9df6e79 15-Feb-2013 Vikram Aggarwal <viki@google.com> Resolve all STOPSHIP comments in UnifiedEmail

Bug 8211088 filed for the remaining case.

Bug: 8132946 Investigate the STOPSHIP comment in EmailProvider.java
wrt PII

Change-Id: I0f93e7bd68360eccbf781c144addf8a8a66ae779
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
a91d00b4de3092b41af5f36436d3b49fe4586f64 18-Jan-2013 Vikram Aggarwal <viki@google.com> Many fixes to detached mode

1. Unselect the top conversation in list (by un-setting activated
state), before entering detached mode.
2. Set choice mode to NONE to avoid changes to the selected state in
detached mode.
3. Allow for recovering from detached mode by tapping on a valid
conversation in the list.
4. Bypass most of the action in CPA.notifyDataSetChanged() in detached
mode.
5. Pop out of conversation view if there are no messages (when
detached and the detached conversation is expunged).

Bug: 8026749 Detached mode triggered even when not detached

Bug: 8025487 In detached mode, CPA.notifyDataSetChanged() shouldn't do
much

Bug: 7337160 Subject and message body mismatch

Change-Id: I7b578ab929ee6a7d18002567b1cf4aaac54b0480
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
c8f2a3c6755b3b78af810aa73ab78487567cf074 08-Jan-2013 Paul Westbrook <pwestbro@google.com> Optimization for detemining conversation position

When the UnderlyingCursorWrapper is created, the positions of
conversations are saved. When the UI wants to determine the position
of a conversation, the ConversationCursor first looks up the position
in the underlying cursor wrapper. Then for each of the deleted items
in the cache map, if the deleted items is before the desired
conversation, the position is decremented.

Note: If the ConversationCursor ever deals with insertions of items
that are not in the underlying cursor, this logic will need to be
updated.

Bug: 7543652

Change-Id: Ic46a16c6e93f9afd08835f2600cbcfbaa6f308aa
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
8d9313bf75dc62b613d1c8a0b3f153f04171274f 04-Jan-2013 Vikram Aggarwal <viki@google.com> Remove static members in ConversationCursor

1. Turn debugging on by default to avoid shipping debugging code.

2. Remove one static member and turn one static into a constant.

3. Fix naming of member incorrectly called sMostlyDead.

4. Turn more members into final.

5. Turn comments into useful javadoc.

6. Remove unused method.

Change-Id: Ie08cc003c1b110cf9baa760cb048a13c2f6de856
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
7460a1c7b617a6a67d3f24c699d0b16a78a3c02c 29-Dec-2012 Vikram Aggarwal <viki@google.com> Remove activity leak

The conversation cursor was maintaining a static reference to loaders
and the resolver. When the cursor was loaded immediately after
orientation changes, the CursorLoader framework returns the existing
cursor. This cursor contained the reference to the old activity. This
also meant that the sResolver reference was stale till the
conversation cursor was recreated.

As suggested by ath@, we remove the static ContentResolver, and rely
on a member.

Also, as suggested by ath@, we use the ApplicationContext, which
removes the inner memory leak that was being caused by the
CursorWrapper holding on to a context, which held on to the previous
application.

Just one activity on rotate (after GC).

Also contains minor code cleanup: removing unused import and cleaning
up incorrect javadoc on methods.

Bug: 7883592 mild activity leak

Change-Id: I09043c38055e5d7ed2fb345286b1f293e39bf4c3
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
4de145bb568b6963d374fa0bac199218dc494186 20-Dec-2012 Paul Westbrook <pwestbro@google.com> Minor code cleanup

Change-Id: Id9758c56795f1cedf3b89b86b0a66c0ac84ebdb8
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
5cc0ab20009100e3ef259fe3d2e3ddc357f79285 11-Dec-2012 mindyp <mindyp@google.com> Update folder changes from UPDATE_FOLDER_COLUMN to FOLDERS_UPDATED

fixes b/7710067 clean up leftover cases of folder updates that aren't yet using folder diffing (FOLDERS_UPDATED)

Change-Id: I145c7ba39ea705772fdb7a47990d3ff7831401cc
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
b2033d855ab0f13e253e5403ce25989bcbc49488 08-Dec-2012 Andy Huang <ath@google.com> Convert rawFolders from String to FolderList

Continuing in the Parcel > String vein, switch rawFolders to use
FolderList, a small immutable Parcelable class. Individual
Folder objects are still stringified when used alone, but those
are not time-sensitive cases (e.g. generating a view intent).

Traceview on Nexus 7 shows 61% speedup in serializing and
deserializing folder rawFolders. Overall time for Conversation
construction appears to go up, but that's because the previously
lazy-deserialization is now done in the constructor. I think
this is okay, since the only performance-sensitive codepath
that constructs Conversation objects is the conversation list,
which always needs rawFolders.

Bug: 7690709
Change-Id: I42eadd79aaeb260f3d9642bf930437a69e510282
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
351ad4e87e0b0b98df9ca88266a8a63541dc5a81 07-Dec-2012 Andy Huang <ath@google.com> use parcel intermediate format for ConversationInfo

Instead of passing ConversationInfo/MessageInfo around as
Strings from provider->UI, use Cursor's blob functionality where
the blob is the marshalled form of the parceled Info objects.

This should be a acceptable use of Parcel, given that we are not
persisting this form, and it only exists to facilitate
provider/UI communication through the generic Cursor interface.

Parcel blobs are fast, well-tested, and do not require
input sanitization.

Traceview testing reveals pretty good gains in Conversation
construction (29% faster on Nexus 7), which is most of the work
in getView().

Change-Id: I05451fba2201ca2f2c3ee76c80fb356c36e8ccad
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
26746eb4acb159f3ce0d411c10d85a1de3e958a0 06-Dec-2012 Paul Westbrook <pwestbro@google.com> Use a single operation to for updates

This combines both the delta update and the full update into a single
conversation operation. Clients that know about the partial update will
use that, while older clients will do a full update.

Bug: 7427595

Change-Id: Iab0ece2c5469d0fd7b8fc5b92acaddc4bfa26add
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
cb0b30ee1d5cfcc267bc7de1e6ad78ed766c1e50 30-Nov-2012 mindyp <mindyp@google.com> Change the UiProvider contract to only send deltas when changing folders

Change-Id: Ic69807f0e8f6ddf06f9e34600089054fe868b9cd
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
99e379ecc14a21c595a14d58c33aeee764f647db 14-Nov-2012 Paul Westbrook <pwestbro@google.com> Revert to old conversation position calculation

Use the old way to determine the position of a conversatin
(pre https://googleplex-android-review.googlesource.com/#/c/250616)

We can't use the underlying cursor to determine position because
it doesn't know about the deleted items. Ideally the ConversationCursor
would contain the map of conversations to positions. Bug b/7543652 has
been written up to track adding this to the conversation cursor

Bug: 7541980
Change-Id: I925956d135d7b8caf73db7d3013b5baa77664f26
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
520172e02adc400132591b9f3f5f48c8de445e0e 13-Nov-2012 Vikram Aggarwal <viki@google.com> Remove unused imports

Change-Id: I9385382f4e425992e2a09d12b4c414e32d959d4f
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
55d664ada644a637ba13128b0fc50086f2abab8c 13-Nov-2012 Vikram Aggarwal <viki@google.com> Merge "Make variables final, reduce scope overall" into jb-ub-mail
0823542b7e2238a764845bc22260d072f638b016 13-Nov-2012 Vikram Aggarwal <viki@google.com> Make variables final, reduce scope overall

Get the authority and the operation list from the batchMap to allow the
batchMap to go out of scope at the end of the method.

Make the authority final in the for to allow lexical closure without
an additional variable.

Save the isUiThread in a boolean so we don't query it repeatedly
inside the loop.

Reduce scope of try to cover ContentResolver.applyBatch()

Change-Id: I1adbce5f2e36d99b26dc240fc0835d62ff89d1f9
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
8883f228890572a8d85d06b1e0bf08c65bd42db4 13-Nov-2012 Andy Huang <ath@google.com> fix position tracker issues that prevented auto-advance

ConversationCursor must unwrap conversation URIs before looking
up in its position table. The other contains() usage from
resetCursor() looks correct.

AAC.setCurrentConversation should init the position tracker
with the new conversation, not whatever was there before.

Bug: 7529090
Change-Id: I4ad7f4550f29a29d2ac666354ea6153da2fc8a88
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
0a22d4482396f3717b36796e594d5f8e9760d509 09-Nov-2012 Paul Westbrook <pwestbro@google.com> Reduce chance of ANRs

Don't iterate through the conversation cursor on the UI thread
in resetCursor(), especially since that iteration happened in a
background thread

In ConversationSelectionSet, don't iterate over the cursor on the UI
thread when receiving a new cursor update, while the user is in CAB mode

Bug: 7502843
Change-Id: I91ed861de594c9469e95d2aef01a9dd18c6d0401
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
5c1d8354ce98be2fc77d458bcc5c3346765046a0 05-Nov-2012 mindyp <mindyp@google.com> Make sure that we get the expected notifications to update the conversation list.

Logging for b/7318651 gmail stopped syncing, or ui stopped updating

Change-Id: I0a6fc2af682a42092356e3038a0b3429f54d5ca6
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
f74147ff72429681d488a75166ec42d434456456 01-Nov-2012 mindyp <mindyp@google.com> Decrement the deleted count.

If the item was deleted, and its gone from the cursor being synced,too,
decrement the count regardless.

Only remove it from the iterator if it was explicityly deleted by the user
or within the time window.

Fixes b/7409999 Gmail seems to be losing the last few rows of messages when archiving
tested against mark's case

Change-Id: I943fc9a40a534b53b0a7bfbbf0986241a07f7967
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
d9e49da6f1447458e43a8152ba6ae6774b957284 27-Oct-2012 Paul Westbrook <pwestbro@google.com> Prevent NPE in ConversationCursor

Bug: 7426605
Change-Id: I825ced9e89fe58b48873b97a167fc5f75b86d2d7
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
7f55c685376659550ed11b047a78cd8d70158ad9 04-Oct-2012 mindyp <mindyp@google.com> Use initial version of the cc cache fix.

We need to selectively do a few things:
1) dont update the conversationinfo if we haven't changed the read state;
this means we wont override the cached conversation info unless totally necessary
2) add sendingstatus to the set of flags we check to see whether or not to redraw
the conversation item

uses marc's initial cc fix

Fixes b/7258975 Reading conversations doesn't immediately mark them as read in UI

Change-Id: I647ebb3d20115b5f73ef50ad0fb860d067d4dfd7
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
7a6dd6e34ad1f6bf672e59f1a60e1c4f8bd758cf 04-Oct-2012 Mindy Pereira <mindyp@google.com> Revert "Preserve cached values for at least 10 seconds"

This reverts commit 37d7a141445d3535f4de779196d8bcc12eba3a30

fixes b/7281777 sending text not disappearing
Change-Id: Id95fab462a3c3da7c44f1aa15009db60f27145da
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
37d7a141445d3535f4de779196d8bcc12eba3a30 01-Oct-2012 Marc Blank <mblank@google.com> Preserve cached values for at least 10 seconds

* Instead of using REQUERY, we'll save the last changed
time of a conversation and make sure there's a minimum
time until that cache entry is cleared
* Remove unneeded Wrapper class
* Remove commented out code

Bug: 7258975

Change-Id: Id618d91c52397a1a7fed162b85c32b975f10b313
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
81a4f08b1657bb297cd977e3df92660fab05a1ab 28-Sep-2012 Vikram Aggarwal <viki@google.com> Update the conversation cursor state in CLF

1. Fix lack of adapter update in CLF.onCursorUpdated().
2. Call ConversationCursor.sync() in onActivityCreated() rather than
onCreateView().
3. Pre-emptive NPE fix in FolderObserver.onChanged().

Bug: 7243503 Selecting notification attempted to load wrong
conversation

Change-Id: If097e3fcf07c68609c8f620160ef598897ab41af
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
c84d251f5cc63ab398ffc6cecc06f801664d0368 26-Sep-2012 Paul Westbrook <pwestbro@google.com> Always return false from moveToPosition(-1)

If a caller were to call moveToPosition(-1) on an already reset ConversationCursor,
true would have been returned.

If a caller was relying on the return value before using the cursor,
(for example, CursorAdapter) we would have attempted to access an invalid
row in the curor

Bug: 7227834
Change-Id: I8a5dec0b7bc1b9cd0cc1a91ba51a61650118d911
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
35f6bba5e600342fb47dc5bd7a90c02fe9e576de 26-Sep-2012 mindyp <mindyp@google.com> Add logging to try to catch the CIOBE issue.

part of b/7227834 positon -1 requested from conversationcursor

Change-Id: I5eb82ba02200215751bfc676e03b59b7f37c4305
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
9735cdca3abbe813f0b9d8f13a4c586c9c0acd8e 23-Sep-2012 Marc Blank <mblank@google.com> Fix CC edge case

Bug: 7103907
Change-Id: I7c23a9996e574a6ae8f8dd6484177ae0d8eecbb0
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
44d5f0af86423462e80b845fbe00b4633321acc0 21-Sep-2012 Marc Blank <mblank@google.com> Revert "Use correct position when moveToNext() in underlying fails"

This reverts commit 2b35105ac3b111e212504d7f77419c3c7fd559c0

Change-Id: I850557ac8967bcbb35bbb4c3474a5223dd3a6b93
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
2b35105ac3b111e212504d7f77419c3c7fd559c0 18-Sep-2012 Marc Blank <mblank@google.com> Use correct position when moveToNext() in underlying fails

Bug: 7103907
Change-Id: I74f26e65e3b63b02502910509c446dd3ad5f9f5f
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
5ef5e0f82082a7e7b31aa185a47843b98ed9afae 16-Sep-2012 Marc Blank <mblank@google.com> Cache uri's in Wrapper to prevent wasteful looping through cursor

* Lazily initialize so that we only make the single iteration
through the cursor when needed
* Also, try to do the single interation in the background

Bug: 7166983
Change-Id: Ic1078daea8d8f6ddf01aaf1275bc08abc9ecf23c
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
1857e9e382b28a1aeb65d5191b44d96d73d4bf33 10-Sep-2012 Marc Blank <mblank@google.com> Handle edge cases in ConversationCursor

* Handle the case in which a DELETED_COLUMN entry is still in the
newCursor
* Rewrite comment to reflect the various cases

Bug: 7131798

Change-Id: I0e5bc55929fafde0a903f3b82242339bb6e536e5
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
6b5b299ceee104ba16a7563da5944520399bb51a 10-Sep-2012 mindyp <mindyp@google.com> Make sure to notify when items have been brought back locally.

Part of b/6761733 Hitting Undo After Archive When Advancing to Another Conversation Does Nothing

Change-Id: Ic60218ca856ef8efbc7788dc508990b73227cea0
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
fe7f5bb113014365746c9e1368773c5448645a9d 10-Sep-2012 Paul Westbrook <pwestbro@google.com> Use ConversationCursor to optimization validation

Since the ConversationCursor knows about the conversations that
have been deleted, we should use that information to prevent walking through
the whole cursor to realize that all items in the batch have been removed

Bug: 7133260
Change-Id: Id9b3f066dda62d66ad93724f8a9c543275a5c3ac
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
cc754b102ed65df9d637b4e0a03e645214ea3ccc 30-Aug-2012 Vikram Aggarwal <viki@google.com> Add a bulk update operation for read.

Change-Id: I95a0756f3b51d534a013613136ce265097f2b227
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
389f0b21a9b21bc3607b810c88272d06d48d0fe6 29-Aug-2012 mindyp <mindyp@google.com> Properly batch up conversation folder changes since they may be destructive.

If they are destructive, we want to be able to undo them, so we have
to make them part of the same batch operation.

Change-Id: I5600f8ef65e31256c44bd33440819264e8e8421e
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
ef3625472596326b910a4445307d1a8eb8c9cc3f 27-Aug-2012 Paul Westbrook <pwestbro@google.com> Added ability to discard drafts

Now the UI can tell the UI provider to discard the drafts for a conversation
(if the provider supports this capability)

Bug: 6315721
Change-Id: If786d13448fdce9a45a54a8762ee1b15e3f29bcd
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
18a9717e1f93f55d5be8b75baa0e9353ddbb25a4 22-Aug-2012 Marc Blank <mblank@google.com> Infinite recursion: do not want

Bug: 7036080
Change-Id: Iaa426da92c540f7a719f78979a6db392f62e6b96
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
e602ae10b24ed61b5fdd651f82b330b7e700d746 22-Aug-2012 Marc Blank <mblank@google.com> Handle completion of refreshTask on closed cursor

* Cancel the task (closing the new cursor, etc.)

Change-Id: Ie499a8ab8ff24655bb96f08c263949fa7fe6c71c
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
e77d5262a98d28de198c06c6ef84b6b70047a60a 20-Aug-2012 Marc Blank <mblank@google.com> Try alternate fix to deadlock issue

* Keep observer activity protected by mCacheMapLock, as before
* Make sure that underlyingChanged() is called on the ui thread
(which was expected by listeners)

Bug: 6957857
Bug: 7013989

Change-Id: I932c488a60e92811aba0f03e6efb02003ff1f2aa
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
28cb53d729459d0835e435efe5dae9cd424b1ad1 20-Aug-2012 Marc Blank <mblank@google.com> Revert "Prevent deadlock"

This reverts commit c33ec4ce932c94c42a2813c666009de2f50d71fb

Change-Id: I219529b396c1a53ee22a1eecc65115e1d07250b9
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
c33ec4ce932c94c42a2813c666009de2f50d71fb 09-Aug-2012 Paul Westbrook <pwestbro@google.com> Prevent deadlock

A lock is held while observers on a cursor are being called. In the
ConversationCursor, we need to make sure that we don't hold the
mCacheMapLock while modifying the list of observers on the cursor

Bug: 6957857
Change-Id: I1bf29935806053e0436970edec6fdc29f9e758ee
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
e5884c70ddc68c55861d0c1b945346316b0ca428 18-Aug-2012 Marc Blank <mblank@google.com> Fix WTF crash related to ConversationCursor

* We weren't setting mPosition properly when moveToNext() failed in
the underlying cursor
* Remove stack trace logging for expected situations
* Optimize long backward cursor moves
* Add some temporary logging for newly added code

Bug: 7012403
Change-Id: I8dcb97539f00dec84bdae74858d7b8efc5e55733
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
44dc44990d6ef7c2f505c7575117becdeb1f1387 03-Aug-2012 Marc Blank <mblank@google.com> Catch null return in doQuery()

* Log the Uri, etc. to help debug
* Relates to 6919664

Change-Id: Ic79611226d1b57ca648a5c5af394a759116b0248
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
70a70c92bca006af84177d025c32deee3aa6da3f 02-Aug-2012 Mindy Pereira <mindyp@google.com> use conv cursor extras instead of folder status.:

fixes b/6917492 Use ConversationCursor for conversationlist status
Change-Id: I256e52459e80290e3d6ec6d3f8adf4de8a9a0c3d
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
04e0dc70c61c1d856877718922f8b1de2f25a2ff 02-Aug-2012 Paul Westbrook <pwestbro@google.com> Fix some problems with conversation cursor

1) If someone called setCursor, the internal state of the
ConversationCursor would prevent new cursors from being observed
2) If onRefreshReady happend while the list is scrolling, that wasn't
handled when the list scrolling stopped
3) If both onRefreshReady and onRefreshRequired happened while
the list is scrolling, when the list stopped scrolling, only
onRefreshRequired would be called, which ends up unregistering the
observer

Change-Id: I1b07b8b41b1025b981f5fdae7d6e2e18568029de
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
e2bde3a97c57b18a84047be03a042e928921a7ae 01-Aug-2012 Paul Westbrook <pwestbro@google.com> Fix crash when logging

Bug: 6911309
Change-Id: I9f2186118a6d1cbbf6031a2343067d719cc93867
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
7ffbaaabf43e2d9d2b6c19b1a061d2c6bf907813 31-Jul-2012 Marc Blank <mblank@google.com> Make sure moveToPosition(0) calls moveToFirst()

Bug: 6885458

Change-Id: Ib3fdd203290c28348fc71d76000a4fe8a74f00d5
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
fc88331cb9a167b7bea7760f788ebf7064bc9608 26-Jul-2012 Marc Blank <mblank@google.com> Revert "Turn off verbose ConversationCursor logging"

This reverts commit b735c9056a542eb3f07a28e501a15c9ccdfd5479

Change-Id: Ib6a29b754e5375f3506e2673031949fe0d1c5669
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
2c4e6dc9eced78a62081d2ec48e5fd618461ea81 26-Jul-2012 Andy Huang <ath@google.com> clean up old cursor notification codepath

Remove logic used before AAC became the arbiter of conversation
cursor state.

Change-Id: Ia2906844b2ac14b978e6c7d2051a2960243fdc5d
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
b735c9056a542eb3f07a28e501a15c9ccdfd5479 26-Jul-2012 Marc Blank <mblank@google.com> Turn off verbose ConversationCursor logging

Change-Id: Id0ca4a6152a83abc6c586c9dd5852369c590da9a
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
daa06aba887e8e3748453f45ae52c1e571fe9f2e 24-Jul-2012 Andy Huang <ath@google.com> fix restore of conversationInfo upon mark unread

When marking partially (or fully) unread threads unread from
conversation view, the change didn't appear to take effect until
the next refresh because I was using the caching URIs instead of
the underlying ones.

Change-Id: I92cfcba1537c08f0609866619e52da4b7b13d53d
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
6c2663dc9cade8aff34c462d244e3d72c475c664 21-Jul-2012 Mindy Pereira <mindyp@google.com> Update conversation read state on the ui side.

Change-Id: I372464e23c39131b45c20ad8bd72ddd6207a1bb5
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
5d8b1fbb708eaa0e1b38e67e0485d31a40b936cc 21-Jul-2012 Marc Blank <mblank@google.com> Make sure moveToNext/moveToPrevious handle edge cases in CC

Bug: 6856048
Change-Id: Ia1a24aed5b1379a91face52553da0463ba5b6ee8
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
fde56a76d6e10958ae8ba19d0a5d8b8df3b601a0 20-Jul-2012 Marc Blank <mblank@google.com> Recalibrate CC if needed before calling notifyDataSetChanged

* After an operation requiring recalibration, we're notifying listeners
before we recalibrate, which means that listeners might end up
manipulating an uncalibrated cursor
* Swap the order of these calls

Bug: 6675825
Change-Id: I91e939f6d5038d2954f15b9b65570d1a210582b9
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
ebdfd98264104cb5a6888acd663970b7c0b31382 13-Jul-2012 Mindy Pereira <mindyp@google.com> Add ability to change multiple values at once for a conversation.

Change-Id: I597bd33c5f647170f8cc06aba79091ac2090f696
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
06642fab1bf4ab95b5dd97a65b262845cf60c865 13-Jul-2012 Mindy Pereira <mindyp@google.com> Make swipe remove label when not in inbox.

Change-Id: I80b22ccd04d3c1b27ebd8af7b84dadea127ed4c4
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
76b2062b8c6d18a7b3a05292c385b47b0fcbd09f 12-Jul-2012 Paul Westbrook <pwestbro@google.com> Support for report phishing

Bug: 4161858
Change-Id: I8b12cfde7e19e388ece83c4df3069f1f65445945
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
77eee625cd8c317c605acfd06cd3a7e22120a0fd 10-Jul-2012 Paul Westbrook <pwestbro@google.com> Support for "unspam"

Also added start of phishing support
Change-Id: If8eb389c2dcc8c285a582504b8213ef676848a30
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
7f602f7a64f176894ccb7942a6642f22584c3894 01-May-2012 Vikram Aggarwal <viki@google.com> Synchronize destruction and remove dead/deprecated code

Change-Id: Ia86449494cca7d4ed5e2d9d515d8afa3dd94b68d
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
3c9bcef43b4f103697034abbf2eab99111e8d987 29-Apr-2012 Marc Blank <mblank@google.com> Fix crash when deleting last item via swipe

Bug: 6359069
Change-Id: Ia59c5109d264d98451a33434b5c66f29592077e9
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
606a6a16188f75d99f811d366c14bd53d71e23f5 25-Apr-2012 Paul Westbrook <pwestbro@google.com> DO NOT MERGE Fix NPE

cherry-pick of https://android-git.corp.google.com/g/183950
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
1c3911727b435524e7d4d0cc66ad3522adbd3453 23-Apr-2012 Marc Blank <mblank@google.com> Restore pause/resume to ConversationCursor

Change-Id: I9fa486c107bffaaa3372f6ab6ed7be14f5633710
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
ca85441f810fdcdd50d285ac5f0319078050c90d 21-Apr-2012 Andy Huang <ath@google.com> disable conversation cursor network access during iteration

ViewPager needs to iterate through the conversation cursor to
match up fragments and cursor rows. Prevent its iterating from
having side effects like unintended network access by signaling
to the underlying cursor that network access should be
temporarily turned off.

Support on the Gmail provider side will be added in an
accompanying CL.

Change-Id: I05231815de53423ff024fc85a59806ddbaa200a6
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
bf232c3735f65b1a4746943e4a134e59e36f0bde 18-Apr-2012 Paul Westbrook <pwestbro@google.com> Major refactor of ConversationCursor

* ConversationCursors are now associated with a particular loader;
there are no static methods or static state fields
* ConversationCursorLoader maintains a list of current loaders
(for tracking/debugging)
* AbstractActivityController acts as a router of conversation
changes to/from fragments (currently message view -> conversation
list)
* Comment out some ConversationCursor tests for now

Change-Id: I9b8425a19c77501796b6681142e1bc0ad20b3693
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
cf164d64bcb1da92b427bda99b97f7ec310ef704 20-Apr-2012 Marc Blank <mblank@google.com> Revert "Major refactor of ConversationCursor"

This reverts commit 5150f03723af8019169aeed8e406784da9c5f8f1.
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
5150f03723af8019169aeed8e406784da9c5f8f1 18-Apr-2012 Paul Westbrook <pwestbro@google.com> Major refactor of ConversationCursor

* ConversationCursors are now associated with a particular loader;
there are no static methods or static state fields
* ConversationCursorLoader maintains a list of current loaders
(for tracking/debugging)
* AbstractActivityController acts as a router of conversation
changes to/from fragments (currently message view -> conversation
list)

Change-Id: I0eb554615b4bf93b3547ff28e2bd5913e8703a97
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
bf128ebfb9aa53d28118e7143d5674e506fedfef 19-Apr-2012 Marc Blank <mblank@google.com> Revert "Controller/Adapter/Cursor refactor"

This reverts commit 67cc73a0ff9bd1c77f84c4af94f6d95f5bdcf490.
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
31e234db245bee3fb2f535d01eb27b3bbd4079a8 19-Apr-2012 Marc Blank <mblank@google.com> Revert "Oops; forgot my latest changes..."

This reverts commit 2b7eaab5ed6661ea3b693434858cd13e38cdd71f.
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
2b7eaab5ed6661ea3b693434858cd13e38cdd71f 18-Apr-2012 Marc Blank <mblank@google.com> Oops; forgot my latest changes...

Change-Id: I7f55f66ecd3cc15d81d498430c571fb1b761068b
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
67cc73a0ff9bd1c77f84c4af94f6d95f5bdcf490 18-Apr-2012 Marc Blank <mblank@google.com> Controller/Adapter/Cursor refactor

* Tie AnimatedAdapter and ConversationCursor together, removing
the "weak link" via AbstractActivityController and
ConversationListFragment
* Remove all throttling code for now (will revisit)

Fixes the ListAdapter changed crash, and almost certainly CIOBE
crashes; will find/update bugs in Buganizer

Change-Id: Ieb6ca7d77b5e64c822960eec2cb46d624c4d8e1e
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
66150d75d09324e867be42ff8c0ea8fae115ef20 18-Apr-2012 Paul Westbrook <pwestbro@google.com> Fix a several problems in conversation list

1) When viewing a non-inbox label, the fragment wasn't being
tagged correctly, so it couldn't be found later
2) Make sure to set sRefreshRequired before calling
notifyRefreshRequired(). Otherwise isRefreshRequired() would return
false.
3) Disable the conversation list throttle. This was causing a delay
of up to 4 seconds when switching labels (especially noticible when
switching to a live label). This is also noticicible when attempting
to load more conversations in a Gmail label
4) Make sure to notify the data set changed listener in sync() so the UI
will know that there is new data.

Bug: 6353342
Bug: 6353444

Change-Id: I54b43a2bf9af3fde308a1f703fb2fc61babc9b6b
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
6c72a787b58a0bc3afcb71093eddf8c29d1cf5ed 07-Apr-2012 Mindy Pereira <mindyp@google.com> Show leavebehind after swiping away an item.

Change-Id: I3bae79ed5bb8919985dbfa6e81416da980281cff
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
e1d1b07cdb0026097eb80f6c2912a16353aacec1 14-Apr-2012 Marc Blank <mblank@google.com> Lots 'o ConversationCursor goodness

* Throttling the cursor!
* Almost dead list items!
* But wait! There's more!

Change-Id: If0fe7b3d22e2dfa0e1d7bb2eaa307d20c52dc21c
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
93b3a157b0a9e7588474d4d24b1fcbb9762bdd04 12-Apr-2012 Marc Blank <mblank@google.com> Make sure CC knows where it stands after add/remove items locally

* Sigh
* Might be other bugs fixed here as well

Bug: 6249265

Change-Id: I6999113bbed0d853dd428b356ec15a73fe3c9c9c
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
958bf4d37a70f456dcda1530f9bb357d88c79300 06-Apr-2012 Marc Blank <mblank@google.com> Call onDataSetChanged() after all changes (not each time)

Change-Id: Id768a6e1831e16d2ed9a8668cc0097f39c9755cc
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
805ff204cee7f11281e4a60f1040ced42e89a986 05-Apr-2012 Marc Blank <mblank@google.com> Prevent deleted count from being wrongly decremented

* This could happen if a refresh() happens before an undo(); the
result could easily be crashes or other bad behavior, as
sDeletedCount drops below zero
* I suspect this will fix a number of bugs, but let's let it soak
a bit, perhaps, before considering them closed

Bug: 6249265
Change-Id: I37c612ceb4d22fc57f1daa96aab316ff8405bef6
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
547daf34cef7d1a9cd5b755e9401120c5c5446b2 05-Apr-2012 Marc Blank <mblank@google.com> Log stack traces if apply() called off of ui thread

Change-Id: Id7858abe0ab0ad56a3a99a6be96f3559763cac40
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
ad6a275b1a6fdb714893696cd8899e1de1d7d59c 05-Apr-2012 Paul Westbrook <pwestbro@google.com> Fix logging

Some string need to be passed in as format parameters

Bug: 6292050
Change-Id: I5bcf397a5de4a35d33f2b994294f682ea8942e76
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
6a62146d0af3bf33ff472e4fbfad64f6c582dd8e 02-Apr-2012 Vikram Aggarwal <viki@google.com> Correct authority for suggestions provider

Change-Id: I363e8f00c7baeed9cae94fe25242594d6e4d4250
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
e3d36791e0e80a0d7065a26e727aedb70863c45a 02-Apr-2012 Marc Blank <mblank@google.com> Handle refresh cancel properly in CC using AsyncTask

* Also add some (temporary) logging in case issues come up again

Bug: 6260664

Change-Id: I18f702deb2c0202ef889cb85d00b1a8a587a9919
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
489dd22c64c718b6953b4bd6acef925e82c53c87 29-Mar-2012 Andy Huang <ath@google.com> add more logging to help track down b/6255909

Track when ListView reads from the adapter count and compares it
to the its last known value.
Track sDeletedCount as it is changed.
Ensure cacheValue is called on a UI thread.

Change-Id: I52e0d8502d36aeb0737af95608a857ea177a06ad
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
9c87fe3200ced388f8d0d7e296d690e2e4fe4b26 29-Mar-2012 Paul Westbrook <pwestbro@google.com> Make sure to notify on any changes to sDeletedCount

This should make sure the ListView is always in sync with the adapter
Bug: 6247961

Change-Id: Idb6163e2bbbc01ff36edac6aa6601bc22b20f032
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
dac6580f96f6ef8f6b466e247834a190a56421e7 24-Mar-2012 Paul Westbrook <pwestbro@google.com> Use print args

Change-Id: Idd658574afc747f286cf2f27abd3aebabcb58f96
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
bec5115726f24733a0a1577caaf05fb6e9ef9c6f 23-Mar-2012 Marc Blank <mblank@google.com> ConversationView -> ConversationList starring

* Star/unstar in the conversation view is now reflected instantly
in the conversation list

Change-Id: I0dade26726bec96610b4c30dded19d36c9dbe439
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
ec7c4da49c023554fb57326f1a8eafa9a53760dc 23-Mar-2012 Marc Blank <mblank@google.com> Try to catch monkey-test crash in ConversationCursor

Change-Id: Ie2df9f93a09c8c749c6513a049c32dea51ee2a7e
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
2596f0011dcb4e86b01fc8a6362b5ac922239571 22-Mar-2012 Marc Blank <mblank@google.com> Local undo

Change-Id: Ifc8152d0549bc0eb4eb09fe6ef44fd5f07b3279d
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
5c31e77a48715313c56514c3da54c92dcffef7e4 22-Mar-2012 Marc Blank <mblank@google.com> Don't reset cursor position in CC.create()

* This is problematic if a draw occurs during a call to create()

Change-Id: Ie9550a85ce75467dab1e99c9f41be1b34852b1f9
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
435fbb5ea2c68f1a76e191eb0240c433c76e2f99 21-Mar-2012 Marc Blank <mblank@google.com> Comment out getRefreshDeletions() for now

* Gmail is returning odd data, and this is confusing things; for
now, remove this (really, no harm)

Change-Id: I32038b91be0c44b7d15f70d6cbee49e73e998283
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
6ca57e8666f0b5e61c77ff8916b553ebcd07287d 21-Mar-2012 Marc Blank <mblank@google.com> Fix refresh of ConversationCursor

* TODO: Try to avoid comparing uri's by making sure the loader
is changed when the account/folder changes

Change-Id: I65626e1907d58f20b68e467bc845d368c4791a42
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
25e3fe356c1c8b38030fed0e0258415d0578b03b 21-Mar-2012 Marc Blank <mblank@google.com> Revert "Handle requery better in create()"

This reverts commit f066d747aa29204de67a1d390860bcabcb325fa6.
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
f066d747aa29204de67a1d390860bcabcb325fa6 21-Mar-2012 Marc Blank <mblank@google.com> Handle requery better in create()

* We were doing the refresh query in loadInBackground() rather than
simply returning the existing cursor and starting a refresh() in
another thread; this vastly speeds up returning to the app
* Also remove some unneeded logging

Change-Id: I03f912dea8149a02f62f08e3338ac559f89afd3f
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
51144944c2088299ebc2584cc09c61c23eb18659 20-Mar-2012 Marc Blank <mblank@google.com> Add "limit" to first load of ConversationCursor

* For my large convo list, time for first query is down to about
300ms from average 9000ms
* TODO: Clean all this up...

Change-Id: Iaa17f5b8b5b773cb4c8133b4f22d7096b3a3aa54
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
09b32383b951afe1dee7845f062fcf8050601f61 20-Mar-2012 Marc Blank <mblank@google.com> Ensure that sync() can't be blocked by create()

* When create() is called with a new Uri, we start a new query, but
we weren't clearing the old one
* This means that sync() could get called and block on the new
query, leading to a potential ANR

Bug: 6198733
Change-Id: I2e8ab0cd9d8e6881eb8c700cbc0259c4dc86eaa9
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
ff5c757ed2bcf7004a70b0675382ef894196558d 16-Mar-2012 Paul Westbrook <pwestbro@google.com> Allow a Conversation to be created with just the conversation
fields

Work around for NPE when marking conversation as read before
ConvrsationCursor is created
Change-Id: I495d408146287de5d6ce7253d2e082cc4d4b4d6a
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
397621b93f83f8933f7a29a9b6d7fe2b88ec4008 15-Mar-2012 Andy Huang <ath@google.com> Get 'mark read' from conversation view->list working (barely)

Conversation view updates a bit on its conversation model.
The model goes through the ConversationProvider caching proxy
to do the write.
After caching the write, ConversationProvider optionally
notifies anyone observing on the global ConversationCursor. This
part is weird and should be replaced by the Controller notifying
on its held reference to a ConversationCursor.
The conversation list adapter is registered for data set changes
to its ConversationCursor (thanks to
FLAG_REGISTER_CONTENT_OBSERVER).
The ListView is registered for data set changes to its adapter.
And the list redraws upon 'mark read'!

Change-Id: Ia465b90733f1cd19dc890a82ca4506178d840f04
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
907b0740de2b9056f638c7b62e1d589a1bf0c9ca 16-Mar-2012 Marc Blank <mblank@google.com> Don't clear the cache when the cursor is reused in create()

Change-Id: Ia7e43582c8fe364e2f97223970a0e5fa60c5c124
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
d9787153f5000b629469951afd95438e2b64b66a 15-Mar-2012 Marc Blank <mblank@google.com> Check that uri is ConversationProviders before stripping authority

Change-Id: I4f298297358174d92ac875c93a05fa54fd1d6aba
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
30fd47bf1947da5ad813cb957b6cbe569dce563a 09-Mar-2012 Mindy Pereira <mindyp@google.com> Remove all label refrences from unified; change to folder

Remove labels text views from unified mail conversation list items.
Gmail will override with a new xml file that will provide a "folders" area
Change-Id: I443b8d73f253f046dfa8a8a68afa19e89bf7a85a
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
3232a96e0ea88741dc39acf17d49e9c22b61c707 09-Mar-2012 Marc Blank <mblank@google.com> Again, get sync() off UI thread

Change-Id: I5c72180bebcab1ca66b44e340e768aec3ae6b03a
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
87cc1237efd0384a33046a7c6fa670df018295a1 08-Mar-2012 Mindy Pereira <mindyp@google.com> 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.
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
2cdaa04b0ef7faf02a47ed25215c5b20fa5b219d 08-Mar-2012 Marc Blank <mblank@google.com> Make sure sync() happens in UI thread

Bug: 6134215
Change-Id: Ib4678108eeb3e51b59ddfdc30a2b9bdabb7d1723
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
e0f91318bff7fc7755eb11380b47f825269803de 08-Mar-2012 Marc Blank <mblank@google.com> Change logging for now

Change-Id: I6d2feaeab6f649f0021d72933c0519887306d8c1
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
8e074ab824cea1fa2b030eacb811220b2c67d6f3 07-Mar-2012 Marc Blank <mblank@google.com> Handle requery cursor null when getRefreshDeletions is called

Change-Id: I4d08aadfacab3c8f9f68bc593c4f3ad4c31613a4
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
3982e236fb2dd36d460df4dbf24e07e8ba55b3bd 01-Mar-2012 Mindy Pereira <mindyp@google.com> Fix up/ back behavior for one pane.

Change-Id: I08ca5364e508eee6910e06fb1b0594a638a6ea0e
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
03fa19afc40791aec7662b2db525c63e78808053 29-Feb-2012 Marc Blank <mblank@google.com> Replace Log.x with LogUtils.x

Change-Id: Ib8513be51bd3f4d06492c918b96e278414f7d26f
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
948985b753588aeda2e83aa71eeb738c19963820 29-Feb-2012 Marc Blank <mblank@google.com> Improve threaded behavior in ConversationCursor

* Also, prevent crash when returning to ConversationListFragment
when a refresh has been done

Change-Id: Icb51a28624e98e131654ecb3e0868d3ead95bd55
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
f362695a339276ea1950c274a5bb8516250552e9 29-Feb-2012 Marc Blank <mblank@google.com> Clean up ConversationCursor listeners

* Remove listener when fragment is going away
* Protect against duplicates

Change-Id: Idfb48848775e8726a59efd5fc251579bff40122d
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
5449aeea2634b1c6589862630d7fabf8f5ae179f 25-Feb-2012 Paul Westbrook <pwestbro@google.com> Prevent crash on activity resume

Handle the case where the requery cursor is set to null before
the listeners' onRefreshReady() is called.

Change-Id: Ifd6caee3e0a963f113630b5a63bffcfc0c67d814
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
c16be931683b00cc625570f0d188e0981141f965 24-Feb-2012 Marc Blank <mblank@google.com> Make ConversationCursor.create smarter

* Use existing CC when possible (either with a sync() or by resetting
* Make sure any existing underlying cursor is closed before creating
a new CC (fix strict mode issue)

Change-Id: I4390850696f3e53aa4769a3ba3011f7a19ce36b6
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
cb0df0a15ae64fcb67ceaa03c13ad2e93efa282b 24-Feb-2012 Paul Westbrook <pwestbro@google.com> Don't close the ConversationCursor in finalize()

This was causing a problem when the underlying cursor was still
being referenced

Change-Id: I722c048607f689a90413ea7bbb3363f67f729123
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
b33465d663235bc45fef4e97d332e652a0f9d769 24-Feb-2012 Marc Blank <mblank@google.com> Synchronize access to listeners in ConversationCursor

* Apparently, these methods are being used from multiple threads,
which can cause a ConcurrentModificationException

Change-Id: I6f60f48570fd145c883cf9314f2d04293894c2d3
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
f83bde45c00c3185af0a1e8084875a7d00fcc17b 24-Feb-2012 Paul Westbrook <pwestbro@google.com> Enable StrictMode in UnifiedEmail

Fix one problem where ConversationCursor was not being closed.

Change-Id: I573c6897bd66453edae369b794970f5d9ef423c7
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
334e64af904085984cdcbecbcbc18cf488a9ceae 23-Feb-2012 Paul Westbrook <pwestbro@google.com> Add support for archive/spam/mute

Add new operations in the UIProvider for the providers that
support archive/mark spam/mute

Fix animations for userdebug builds

Change-Id: I2e6372095f7ce6d29d37768e1075a098ca3a7646
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
830c00f18b199f4eb2b2cc05b7038b8b05d8eca9 22-Feb-2012 Mindy Pereira <mindyp@google.com> Add mute/spam.

These only show when the account supports the operations.

Change-Id: I2e4852f748ee4653ac8593a6df5f74308cdefa53
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
f98b318572750dae998a55a60199598933770b68 22-Feb-2012 Mindy Pereira <mindyp@google.com> Seperate undoable ops (destructive) from not undoable (not destructive)

Added archive, folder changes that delete conversations
Set archive to only show if the app supports it.

Change-Id: I85babea1083a41168a6f036dddb4abad707e629f
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
8e915724b6e4374da9b70161ee0a55f0c763e563 16-Feb-2012 Mindy Pereira <mindyp@google.com> Take loading of messages associated with a conv off the ui thread.

Also, removed unused activities.
Change-Id: Ib80e71dce03a3821a0e27e9e2d638280dad0ce83
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
609480e14d4cb999d9b6bb1c224b3584d3f367f0 16-Feb-2012 Mindy Pereira <mindyp@google.com> Get loading folders/conversations off the ui thread.

Use loaders. Pretty.

Change-Id: I0d87ffa8e390f15718c71f05977ff6d331aeb9ca
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
f9d8719ff6378e44d41b7586756ea9b6efac8fdf 16-Feb-2012 Marc Blank <mblank@google.com> Catch exceptions on unregistering observer

Change-Id: I4beb9f08d98c8314a58cba1f47c98bfbc5725164
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
b600a83dfe6d0ec0b342de9b11f3b185b048ab93 16-Feb-2012 Marc Blank <mblank@google.com> Allow multiple ConversationListeners

Change-Id: I207e58845b69240f70b9f46673861fe4d450cdd1
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
77177b171c483d485bdbff0178564394e8f57d0f 08-Feb-2012 Paul Westbrook <pwestbro@google.com> Start of restructuring to allow overlays include subset of providers

This allows us to build a UnifiedEmail that supports all providers
and use this base to build applications that only supports a subset
of the providers

Made AccountCacheProvider and ConversationProvider abstract. This allows
the extending class to specify the authority that should be used (This allows
both UnifiedEmail and Gmail to be installed at the same time)

Change-Id: I31295f4630906e7182e423fcbb7b47c33ba4cd4f
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
248b1b49455785aa2fa426bc28090547abfcb01a 07-Feb-2012 Marc Blank <mblank@google.com> Start of unit tests for ConversationCursor/Provider

* Includes modified TestProvider code originally intended for
the Exchange application (as MockProvider)

Change-Id: I40126892c2177260a8eb1ace6e21e47a9ecf7665
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
995fff5b8367f91da95850b662ddd65a2e08e9ea 06-Feb-2012 Marc Blank <mblank@google.com> Fix typo on update/delete code

Change-Id: I7cdc24ff0dd487e285dd70c34df4320017a1dbb0
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
3f1eb8517cf7db29ceafa1912ae999af186e2856 04-Feb-2012 Marc Blank <mblank@google.com> Add nicer undo support and some debug logging

Change-Id: I2b2c36e1be6ef7d07890e16b0721cd133421c830
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
ce53818e1e185a845bd2f7f601c20e7085b40725 03-Feb-2012 Marc Blank <mblank@google.com> Support string updates & update-with-local-delete

* Works for Email "move to folder"
* Moves animate away (like deletes) - yay!
* See TODO's for Gmail support

Change-Id: Ibb75fb1c3c5ac3df32f8f1da93274313299170da
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
4e25c949d04e42ec6bf84baef52e99c13e83ac9f 03-Feb-2012 Marc Blank <mblank@google.com> Add polling methods on CC; refactor

* Added isRefreshReady and isRefreshRequired methods on
ConversationCursor (for polling)
* Renamed swapCursor to sync

Change-Id: Iec7fd4141780408e0f9fc8f0eb3d68dc2081ade5
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
8a77f8b15c32077480a27a00e759b93f05634b79 03-Feb-2012 Mindy Pereira <mindyp@google.com> Notifydatasetchanged AFTER deleting items in the synchronous conversation cursor.

If we do it beforehand, then the items just come back, since they
are no longer marked as animating.

Change-Id: I9a81068dc3ce2d5f0702c59f4d6583693f883c04
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
c43bc0a606e41144a780c4f873b5450e0ede0c91 02-Feb-2012 Marc Blank <mblank@google.com> Use uri rather than messageListUri for Conversation operations

Change-Id: Icc30cdfd3cce1fcb3b0119ef6008e981e1c14ac4
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
dd10bc8736282262da0cd9a5f9a0236c10b47028 02-Feb-2012 Marc Blank <mblank@google.com> Don't recycle animating views, etc.

* And a few twiddles to ConversationCursor
* And make Conversation.delete/updateBoolean return
a sequence number

Change-Id: I79867e1ce562246eabecfd1c4eff686647578503
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
1b9efd9beb715927e0db7b138ddbb2925bc2c06f 01-Feb-2012 Marc Blank <mblank@google.com> Make Conversation operations return a sequence number (for undo)

* The implementation for undo isn't done, but the plumbing exists
now for the UI to pass a sequence number with the undo URI

Change-Id: I2c57c475464d828bbcb21ec0d1f42588bb238f63
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
b31ab5aea601f8aa5136a99edc23fb4d907f792e 01-Feb-2012 Marc Blank <mblank@google.com> Add provider support for undoUri

* Also added "seq" parameter for undo support in ConversationCursor

Change-Id: I482e4db437826276e4c13c60835259be175f7a4f
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
4015c182ab04edaa7cd8b75490f4336348ec29da 31-Jan-2012 Marc Blank <mblank@google.com> Get server deletions and allow for animated deletions

* Added another listener API for CC
* Fixed a bug related to > 1 updates from server

Change-Id: I0bc2654bec1e63e49dc0f4ac48325851d3380e67
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
03bbaadd114b39cdac91be7384d1b311db67c7c5 31-Jan-2012 Marc Blank <mblank@google.com> Remove code that's no longer needed

* Redraw list (for now) after updateBoolean for setting star
and read on selection sets.

Change-Id: Ia4b482841bbc0f0a9cf516d68aa9d4f63e7510e1
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
f892f0a57d5c24b09fdc805f0fe2007ecd0d0e91 30-Jan-2012 Marc Blank <mblank@google.com> Refactor of some ConversationCursor code

* Quickly return positions of items deleted/updated

Change-Id: Ia1cc20bfcc5ab1958ec8c514321a1cc046dd81c3
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
48eba7a1eedf6c06b7783d49f44e61fc117f69bc 28-Jan-2012 Marc Blank <mblank@google.com> Handle UI updates during underlying cursor refresh

* Add new notification for when refresh is finished (i.e. the
conversation cursor is synced with the underlying cursor)
* Still considering notification for changes that happen during
the requery (i.e. calculating sync inserts/deletes, for example)
* Query of underlying cursor is now done asynchronously

Change-Id: Idbe6a4729ad5ea896a9522b11286044f0a552f2e
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
8d69d4e10a9a36ff790babb2f3a098a12d0dc732 25-Jan-2012 Marc Blank <mblank@google.com> Enhancements to Conversation/Cursor/Provider

* Added methods in Conversation for doing batch update
and delete (e.g. from selection screens). The batched
changes reflect immediately in the conversation provider
and are then executed in a single transaction in the underlying
provider.

NOTE: If called from the UI thread, these operations will
not block (the underlying provider is called on a new thread);
it's expected that update/delete will almost always be called
on the UI thread. Where the result of operations is needed
(i.e. a Uri return from an insert), synchronous operation is
required; this can be done by calling on a non-UI thread.

* Support for selection -> add star

* Also, quick and dirty implementation of read/unread, both
by reading mail and by using selection -> mark read

Change-Id: Ia060cdf21b2f9f3960315c746e81c04ae3afc6a1
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
d9f8558565000127e7dafe7ba7934ceb09b246bc 25-Jan-2012 Marc Blank <mblank@google.com> Fix fencepost error in delete position determination

Change-Id: Iaa9b405ad437cae06d165ad8d1d74866ce08d7fa
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
d3818654c103802704fc788cf9c6775d25b65bff 25-Jan-2012 Mindy Pereira <mindyp@google.com> Clear selection after a destructive action.

Change-Id: I4e6faed97452ccb5ec0ef3d37f2c9a72b1d406fe
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
3c439763dc2904602e96db82139f2f310cfea9ee 24-Jan-2012 Marc Blank <mblank@google.com> Make ConversationProvider insert synchronous

Change-Id: I1df2bfc70e7dd11d8cbc23efa8986de1ed0d4b80
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
97bca7b52aa2840494753d700a641161099cde23 24-Jan-2012 Marc Blank <mblank@google.com> Use ConversationListener to initiate redraws when data changes

* This puts the ListActivity fully in charge of updates; when
onNewSyncData is called on the listener, the activity is
responsible for calling requery when it wants to actually
get the data (i.e. the screen will NOT be redrawn out from
under the UI)

Change-Id: Idd7d9d9098ec9b8f19ea608a72bc6a37d6277e44
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java
c8a994227b9c686d88ee05840544162711a85712 19-Jan-2012 Marc Blank <mblank@google.com> Prototype ConversationCursor/ConversationProvider

* Handles updates/deletes from the list instantly, then forwards the request
to the underlying provider
* Only starred/delete are implemented currently for Email types; the Gmail
provider doesn't yet support updates to UIProvider uri's
Note: Email types support read there's no read/unread support in the prototype
UI
* Updated UIProvider/MockUiProvider with latest adds to Conversation class
* Underlying provider must notify ConversationCursor of changes via newly
defined notifier URI

TODO: ConversationCursor wants unit tests

Change-Id: I91babcd5c27109acaa1f7479d584524e8a508a56
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ConversationCursor.java