History log of /packages/apps/Email/src/com/android/email/provider/ContentCache.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
bc47398187c6ffd132435e51d8d61e6ec79a79db 25-Sep-2012 Paul Westbrook <pwestbro@google.com> Merge Email1 into MR1

Change-Id: I45289d46b65faffc7a3a3dd46382899162f3aaab
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
cc0185f07c9198008d8dc685ae9979f3e35e8539 28-Jun-2012 Marc Blank <mblank@google.com> Manual merge of Email from jb-ub-mail

Change-Id: I564ddf433d371f45ba78a10f73bb182d484c56f2
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
03cd72805dab0379ed255d151f1c17cc60655fc3 25-Apr-2012 Marc Blank <mblank@google.com> Revert to old Email app

* These are the last sources in the ICS-MR1 tree

Change-Id: Ida4651bddd92a06a518d00f3e1f275ab3a80c8ae
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
d16fa893d1a24497147fd91b32698ff7bf695600 20-Jan-2012 Andy McFadden <fadden@android.com> Use Map.Entry, not HashMap.Entry

Map.Entry is the defined return value from entrySet(). HashMap.Entry
shouldn't be used directly.

Change-Id: I855f7a4e855776deb83754ca89c2a4128e9e04a2
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
a91f33b44b967496d16ef5ed443219df3d97d8c4 19-Oct-2011 Marc Blank <mblank@google.com> onMove in CachedCursor shouldn't call the underlying cursor's method

Bug: 5472277
Change-Id: Ida5a840d2d27941bb8b548a4d2d985b1082e93b6
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
d12f78d6bac81590f97fc190723865ffe65e5d69 22-Jun-2011 Marc Blank <mblank@google.com> Fix cursor-related errors:

1) Have CachedCursor implement CrossProcessCursor; still need to
figure out how this ever worked
2) Close cursor used internally in findMailboxOfType

Bug: 4869024
Change-Id: Id20d37b7b83e133aa4d5fe9293a42ae217024f01
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
6e418aa41a17136be0dddb816d843428a0a1e722 19-Jun-2011 Marc Blank <mblank@google.com> Improve EmailContent caching...

* Guarantee that up to 16 Account (with HostAuths), and Policy rows
are always cached. Also, 6 commonly used Mailboxes per Account
(Inbox, Outbox, Drafts, Sent, Trash, and Search)
* Precache these rows when EmailProvider starts up
* Ensure that newly added, precachable rows are cached when created
* Clean up some inefficient/wrong caching code
* Fix a commonly called method in NotificationManager in which we
load a single Mailbox row using selection vs withAppendedId
* Confirm that we don't read from the database in typical use and
heavy message loading
* Add a special URI for finding mailbox by type (using the cache)
* Add special-case code for EmailContent.count(Account.CONTENT_URI)
which is used in a number of places (including on the UI thread)
and whose value is easily determined
* Add a special URI to get the default account id
* Confirm that all unit tests work

The goal here is to be able to load all Account, HostAuth, Policy,
and Mailbox objects (by id) without worrying about disk access.
There will still be a single disk read for uncommon Mailbox reads,
but this should be considered acceptable.

Change-Id: Ibc9aa7acc73185e360b0b6f3053b90a985e97210
TODO: Unit tests
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
78849fd388041d8727325aa654de31dcb8088786 08-Jun-2011 Todd Kennedy <toddke@google.com> Lock cache puts while running tests

Change-Id: I04c88ee70f9d72252fd1c5114d560a28fcee1b56
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
5d29dac8065e75b040aeb29401630fd65fedb9fc 26-Feb-2011 Jesse Wilson <jessewilson@google.com> React to LruCache.entryEvicted renamed to LruCache.entryRemoved

Change-Id: Iab20ce0386ee4dabc8490dbde5cd2208626c293c
http://b/3461302
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
92ab6db38dcf15f6935463845fc4fa749a292b3a 11-Feb-2011 Jesse Wilson <jessewilson@google.com> Adopt LruCache in Email's ContentCache.

LruCache simply wraps LinkedHashMap for a better API.
Performance/hit rate should not be impacted.

Tracking bug: http://b/3184897

Change-Id: Icbac38d3cea5f8c522df7a883d8e74a8f3786b92
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
3aee641aab491a3da53364aafb9074ae69dd2212 26-Jan-2011 Jesse Wilson <jessewilson@google.com> Use a field rather than a superclass for ContentCache's cache.

This makes it easier for cache experiments to swap out the
LinkedHashMap for another cache.

http://b/3184897
Change-Id: Iacdb266e41f5a98efd9bb30bc09ff8fff5a0a5a9
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
f1b510462fad73de1e7f7bfad2f0637c9cf65cd7 01-Feb-2011 Todd Kennedy <toddke@google.com> Fix ConcurrentAccessException in unit tests

The ContentCache is now an LRU cache. This means we must NOT access the cache
while using any iterator over the cache. In this case, we were calling get()
using an iterator of cache keys.

Change-Id: I2d1feabff7474b6f2a230b98f97df067ab7ccd9c
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
a86265e8e5e72c61a0eafd966ca02b8438c10798 29-Jan-2011 Marc Blank <mblank@google.com> am 9a09129d: am 1122e0f6: Merge "Remove cache statistics logging" into honeycomb

* commit '9a09129d0928712ad84a11027812ff0a63afed4a':
Remove cache statistics logging
f40294e1aac1f7cd92c02d8a39edc40676fe3c55 28-Jan-2011 Marc Blank <mblank@google.com> Remove cache statistics logging

* Use static final flag to control this
* Set flag to false for all commits

Bug: 3403725
Change-Id: I70c89aaf2f0b226206e505a14e9a8f1ed2ebb51a
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
50c7d755a70895cfaa927e52c23bf0b0d2512797 28-Jan-2011 Marc Blank <mblank@google.com> Make ContentCache LRU, rather than LRI

Bug: 3403111
Change-Id: I12993a8185db1bebe760f8bd1a8d22683bcdddc3
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
788408dee4ef861a5b3196992984d7aad4889992 26-Dec-2010 Marc Blank <mblank@google.com> Fix synchronization issue w/ closing CachedCursor

Bug: 3306031

Change-Id: I3000cf92c27e93b2df94799492fb9960a3d795dc
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
d9b251d23b30e25cf388fbbc1a9bdbb3f7caeebd 20-Dec-2010 Marc Blank <mblank@google.com> Properly return zero-count cursor from getMatrixCursor

Change-Id: I574528bf56b5a82ecbaab3d3501b26e7afb974ec
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
497039234182170ada90e63e96650b5675429ff5 16-Dec-2010 Marc Blank <mblank@google.com> Synchronize properly with ContentCache; document synchronization

Bug: 3291682
Change-Id: I69c4a3b2ee62a41e6488b63deeb975e510a3f554
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
74596b3799093fa50603d4cd8df7ee1f74b46c05 15-Dec-2010 Marc Blank <mblank@google.com> Enable cache logging for debugging (w/ STOPSHIP)

Change-Id: I97493430f2aedcb070bc6d1789e47b562394eeb3
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
c159d32be05ee744f3726579d9cd8eed39545137 03-Dec-2010 Marc Blank <mblank@google.com> Never close underlying cursor if there are active users

Bug: 3249537
Bug: 3238216
Change-Id: I281f0b0d6319adaffd78fe8e4c3da6f126eb71da
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
68dc380d62b29b4b6733bc1b20e44b8931c1d341 30-Nov-2010 Marc Blank <mblank@google.com> Don't throw exception on moveToPosition in CachedCursor

* Just return false

Bug: 3240290
Change-Id: I808ca88c7897c573d19c2c2c92b179b4106a6dd3
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
5835dcecedb4f6a7bd3473cce172de0fb699cf98 23-Nov-2010 Marc Blank <mblank@google.com> Fix deadlock in ContentCache

* The situation is that putCursor() is called from a reading thread
while invalidate() is called from a writing thread
* putCursor() must not hold the monitor lock on ContentCache while
moving the underlying cursor to position 0

Bug: 3224203
Change-Id: I35b798dccf245c761dc79c39ced4fc8c0cfb9d78
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
349055aad47184b72cd86de1f37ac1b7557d2e70 17-Nov-2010 Marc Blank <mblank@google.com> Allow ProviderTests to work with ContentCache

Bug: 3204331
Change-Id: I5399345c2b759fb34d3dc7c694eb0eef8d7de493
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
2199c7ddf5d497e816bef1a1b7473098369a1bdf 17-Nov-2010 Andy Stadler <stadler@android.com> Minor cleanups for ContentCache

* Change CounterMap to not extend HashMap
* Renamed remove() to subtract()
* Comment out a failing test
* Add a flag that prevents any objects from being cached

Change-Id: I74754133b505178e8b0166390f69509f006a3da2
/packages/apps/Email/src/com/android/email/provider/ContentCache.java
fab77f147f85766d2f75d8aece0aaa4ffb3838e8 28-Oct-2010 Marc Blank <mblank@google.com> EmailProvider content caching

* In this CL, we cache individual rows, based on the CONTENT_PROJECTION
defined for the most common queries (Account, HostAuth, Mailbox, and
Message)
* Queries on individual rows (most often Class.restoreClassById()) will
look to the cache first, rather than querying the database
* Queries on smaller projections will build MatrixCursor's from cached
data
* Write-through caching updates the cache with changed columns
* Experiments with live data indicate that > 95% of queries that are
cacheable (single row, no selection) can be retrieved from the cache,
thereby saving a great deal of disk access.
* Timing experiments show that cache hits are > 40x faster than cache
misses
* Unit tests for the various classes exist, with more coming

TODO
----
* More unit tests

Change-Id: I386a948a2f4cc02b6548d07d9b2fefd1e018a262
/packages/apps/Email/src/com/android/email/provider/ContentCache.java