It's possible to have multiple EmailProviders.
Also get rid of references to the multiprocess attribute.
Bug: 10388165
Change-Id: Ic6be363eaee20b3b5deddc7b3054d1a7419483a1
It wasn't working right anyway.
Also, fix a problem where account settings were
not being fully initialized.
Bug: 8384097
Change-Id: Ia60ace2ce618b64fe4ad5ef8d8ac547a086a26d5
b/10380970
This could happen if the response to the POP3
RETR request did not contain a content length.
Change-Id: I99ad93ec71ba917e0f36bee204d7f8d05c79c5ff
We were always allocating a one element array in
a loop. We can just keep create one array and
reuse it.
Change-Id: Ia44f0b711ef48fb87030c3f09f3f9fb654717b7a
The IMAP time based query only takes a date, not a
date/time. This means that if we want to load all
messages since, for example, Aug 11 at 3:00 PM,
we'll actually get all messages since Aug 11 at any time.
Our local query actually took into account the time, so
when we loaded a map of local messages, it would not
always include all of the same messages that the IMAP
query would. This meant that if we processed a message
that was in our IMAP query window but not our local query
window, we'd always think it was a new message even
if it wasn't.
It's easy enough to increase the size of our local query
window so that it will definitely include all of the
messages the IMAP query might return, but this adds
a new problem: It's no longer safe to delete any local
message that did not come back in our IMAP query result.
Since our local query may include a larger time window
than the IMAP query window, we need to check each message's
timestamp, and only delete it if it is inside the remote
query time window.
Change-Id: Ib3c1bbe8f3db05720d32a981483676afa6d6c38b
Deleting .db files can make malformed database issues
when WAL(write ahead logging) mode is enabled.
EmailProvider doesn't use WAL mode currently,
But it has to be fixed because it might cause the problem in the
future.
Change-Id: Ie0313c5d253f3080401b00b197e7cbf97f25423c
Conflicts:
src/com/android/email/provider/EmailProvider.java
Use DatabaseUtils.longForQuery() method instead of SQLiteDatabase.query().
This reduces processing cost of database cursor.
Change-Id: Ibe53645b32a4de1ab6518f879e564ddf8f75d822
Conflicts:
src/com/android/email/provider/EmailProvider.java
b/10075523
Now, every 15 minutes we'll sync the last 24 hours.
Every 4 hours we'll perform a full sync, which will
take either the last 7 days, or until the oldest message
we already have locally.
Change-Id: Idc55a46a28af2a68cc324e414d51d88373941595
uifolders and uiallfolders cursors now setNotificationUri on
the appropriate uri. That uri is notified whenever:
- A folder is inserted, deleted, or modified.
- A message is inserted or modified (since this can affect
message counts).
This second one is still not quite right: there are some
conditions where counts aren't updating correctly.
While I was here, I renamed the notification uris to
avoid collisions between different versions of the app.
Bug: 9111855
Change-Id: Ia29bb6a65b4f673bf352fdf0e14270b3f1443ca8
b/10111339
b/10125810
The first problem was that the imap BEFORE clause
is exclusive, so messages on the date given in
BEFORE will not be sent. Now, on the sync for the
most recent messages, we will just not specify a
BEFORE clause, so we can always get the most recent
messages even if our clock drifts from the server.
The second is that some imap servers do not accept
time information on the query dates, and that causes
errors. The imap spec defines the BEFORE and SINCE
clauses to come with a <date> only, not a time,
and although it seems that at least some imap servers
handle that, it can't be expected to always work.
Change-Id: Ibf41c6f7600b9f9537bc6d13b59873ee36798e1e
b/9857766
If we currently have zero messages (i.e. initial sync of
a new account) we will load the most recent 100 messages.
On subsequent syncs, we will load more recent messages
until either:
1. We have loaded 100 and not yet past any of the messages
we already had locally, or
2. We encounter messages that we already had locally, and
then load "deltaMessageCount" additional messages past
the ones we have locally.
Change-Id: I8b34409dcdaceff2d2e1906174241a74f2331688
I'm formalizing the concept of folders that must exist,
and the list of such folders should be accessible to all
sync adapters.
Change-Id: I9e4d2d51aa495d211eab2d1e36c3fa197a1ac00d