Commit Graph

63 Commits

Author SHA1 Message Date
Jorge Ruesga 08ace26ed6 email: imap push
Change-Id: I8a184a5644e4322ee65d969e14cd47fe119f5df2
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2015-10-18 14:05:32 -07:00
Jorge Ruesga 598a070c27 email: support for auto-sync multiple IMAP folders
This enables to auto-sync multiple IMAP folders, not only Inbox. Default to Inbox only.
This changes relays in the syncloopback attribute to configure the folders to add to
sync process.

Change-Id: I8973cfd6ddec33446256bc8b48418558e27596b5
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2015-10-18 14:03:22 -07:00
Tony Mantler 2f288864b6 Fetch email bodies using ContentResolver#openInputStream
This brings us further along the path to storing email bodies
outside of the database.

Change-Id: I96296114ade0d561df724878ed92999306bcd176
2014-05-08 15:50:57 -07:00
Tony Mantler d3154ecc6e Warnings and finals
Change-Id: Idc31b2f3376db73b90558fb22bdcdf4ff6f92b7d
2014-04-29 13:36:24 -07:00
Martin Hibdon cb30243fe1 Disable sync settings controls for drafts folders
b/11158759
Make the default sync setting for drafts folders 0
(never automatically sync), and disable the settings
control so that it cannot be changed.
Also add a db upgrade step to set any existing drafts
folders to not sync, and clean up any Exchange synced
draft messages.

Change-Id: I256bde231d722089ef2a623482f570a20eccf1de
2013-10-10 16:29:42 -07:00
Martin Hibdon 56aba8d843 Allow multiple mailboxes to be synced in a single request
b/11103878

Change-Id: Ic6abf51457fe94e89fe51b461da4371f50e0fe86
2013-10-10 09:30:31 -07:00
Yu Ping Hu 19675e8bd7 Add a mailbox type filter for syncing.
Bug: 11081520
Change-Id: I76bcc0db08d2def3418849b9536b2e7ac1769f34
2013-10-07 22:16:47 -07:00
Martin Hibdon 6700000ad1 On initial sync, do inbox first
b/11081520
This improves perceived performance, the inbox
messages will come in before contacts and calendar

Change-Id: Icd9630d9cd2fb79a54d0ed2c11702a1a3091ed7e
2013-10-04 16:01:10 -07:00
Yu Ping Hu cae08a64fb Fix my query. Again. :(
Change-Id: I2453bd3daa00f16cecdec8da93b21b98ae8d5e7b
2013-10-04 15:02:28 -07:00
Yu Ping Hu 29984af2b2 Fix a sql statement.
Change-Id: I32cb6f5e52173059b08a83cbf65c9e4ac31302b4
2013-10-04 14:53:42 -07:00
Yu Ping Hu 3f24a9e2c7 Don't push things that haven't performed initial sync.
Also remove the ping kick.

Bug: 11081520
Change-Id: I21d5050886b2c352771013f4f3e5b9282482d508
2013-10-04 14:36:43 -07:00
Martin Hibdon 921c04d2ac Add some logging
Change-Id: Ib26ffad0bb6841361b8ee7be4ee2a6255d509ae2
2013-10-01 17:08:16 -07:00
Alon Albert 29d886ced7 Implement a resyncMailbox Method
Deletes all messages in a mailbox, resets the sync key and requests a sync.

Only supports Mail mailboxes for now.

Change-Id: Iab8c051631f38687c02a22cb80ce4f50c2d9c6f1
2013-09-19 08:27:41 -07:00
Yu Ping Hu e984940465 Fix MessageStateChange to include mailbox id.
Also ignore messages without server ids for moves and
state changes.

Also cleanup to match needs of EAS upsync.

Bug: 10678136
Change-Id: Id4d5229b8479e61bd718b707b0d2bc77a9e68046
2013-09-15 15:43:35 -07:00
Paul Westbrook e568f1bd37 Use resources for authority/package name
This will better handle the case where the Email package name
changes from the "orignal package name"

Bug: 9763397

Change-Id: I8e01620551ce473e389e6a13963caaf685aea221
2013-08-20 17:55:47 -07:00
Yu Ping Hu 2bafe9d904 Add a utility function to map mailbox type to authority.
Change-Id: I21731a5d9ba45850577fdda4d6bef8835d6d3249
2013-08-09 17:30:32 -07:00
Martin Hibdon d42e14ad72 Merge "Implement two part imap sync" into jb-ub-mail-ur10 2013-08-07 20:30:00 +00:00
Martin Hibdon c75f5880ab Implement two part imap sync
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
2013-08-07 12:26:24 -07:00
Yu Ping Hu c3ceed6894 Fix ui notifications on folder list changes.
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
2013-08-06 20:37:35 -07:00
Yu Ping Hu 2535e03ab2 Remove some unused functions.
Change-Id: I1df1cf8af01c81c47b11a1f44be819f8c384cf85
2013-08-05 17:43:00 -07:00
Yu Ping Hu 6602918f96 Add checks for whether a mailbox is syncable.
These will be used in Exchange and eventually in IMAP.

Change-Id: If04c78556a1e52f1daa18bc3be0dc3def3c48957
2013-08-02 13:47:53 -07:00
Yu Ping Hu eb4ee8a7aa Move required system folder types to Mailbox.
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
2013-08-01 16:19:28 -07:00
Martin Hibdon 2503179606 Update IMAP sync method
Now it syncs using a date range query.

Change-Id: Ia520fbbe39521b1356acaf0fe764f9bdcc1aeb82
2013-07-24 17:57:07 -07:00
Yu Ping Hu 6e0f74de93 Add a constant for push-only sync requests.
This will be used in Exchange, but the constant belongs here.

Change-Id: I5be3bae75ccaa0562230252226375b25028dfb76
2013-06-27 16:55:56 -07:00
Andrew Sapperstein cdee4b0c11 Use resource strings for system folders.
Fixes b/9193813. Previously we returned
a value from the database in all cases.
This meant that system folders were not
translated.

Change-Id: Ife568651886bfb6de76221b8bc5d013dac8fa21a
2013-06-26 18:20:10 -07:00
Yu Ping Hu a54ee609cd Convert Mailbox syncInterval column to boolean.
We are no longer doing per-mailbox sync intervals; instead,
mailboxes opt in to syncing, and the account sync interval
controls what happens.

Change-Id: I8ae32ea25079abbb63bb6a6a282bf5c06de73fca
2013-06-20 18:38:48 -07:00
Yu Ping Hu 6f2beeb59a Add "account only" periodic sync for push accounts.
EAS push only gets changes to the contents of collections,
but not for changes to accounts or folder structure. This
adds a new sync type to fetch only accounts, and adds a
periodic sync of this type for push accounts.

Change-Id: I1e9337252dbb5e53db3f7c5953e089de2c69d18c
2013-06-20 15:46:29 -07:00
Yu Ping Hu e7ebb5de04 Remove references to deprecated sync states.
Change-Id: Ib22bac766fb0ac4d6e764ee92b56a8026baee852
2013-06-19 17:10:43 -07:00
Yu Ping Hu aa0ca16a27 Remove references to account mailbox.
Exchange implementation no longer uses them.

Change-Id: I221a914f2428c0c7989f79392ca82f7a8f4b1c52
2013-06-17 19:51:47 -07:00
Scott Kennedy 560bfadc31 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: I55f1c7a66ce50ead54877a13e40256422a56dc39
2013-06-05 20:06:15 -07:00
Yu Ping Hu 9e7f5a2a33 Use system SyncManager for Exchange.
Change-Id: I77e4e75c94c532d22a28cf97e6f55f1259b8bdde
2013-04-25 14:03:00 -07:00
Yu Ping Hu 503cc0630d Stop using ContentCache and related caches.
Bug: 8655671
Change-Id: I349ce464b5d752b3ac687852dbce4f0b57e04c67
2013-04-19 11:09:15 -07:00
Yu Ping Hu 17d5bbf768 Improve mailbox sync and load more.
- Update syncTime for IMAP and POP whenever we sync.
- Change load more to simply include the delta in the RPC
  rather than using the visibleLimit column.
- Add a query to get the message count for a Mailbox.
- Refactor code for updating totalCount and determining
  the new message count when syncing.
- Remove dead code from Mailbox.
- Remove uses of visibleLimit from code.

Note that visibleLimit and messageCount in Mailbox table are
no longer useful and will be removed in a later change.

Bug: 8579767
Bug: 8523146
Change-Id: Ieb67e3b6f1c82c3b21b972c5a1e557cd75dc21db
2013-04-11 21:06:08 +00:00
Yu Ping Hu c065e72819 Add virtual mailbox for all unread messages.
Also restores the trash icon. I'm not using the "correct"
icon -- it's the menu icon, not a folder icon -- but it
looks correct. Also, the "unread messages" icon is likewise
the menu icon for mark unread.

Bug: 8527132
Bug: 8444885
Change-Id: I7d3bc286f80f130e6f08ff1340a013d81700406e
2013-04-05 14:50:50 -07:00
Yu Ping Hu c5c9c1c69e Restore functionality for uploading new messages.
The code for syncing new messages from client to server
somehow never got moved from Email1 to Email2.

This change also includes minor cleanup on system mailbox
flags.

Bug: 8531552
Change-Id: I1f9396635ba14cb6e641d2bc1b506c6d702f6b2e
2013-04-03 09:32:35 -07:00
Yu Ping Hu 9ae81e2af0 Move system folder string resources to emailcommon.
This permits us to move shared code for looking up system
folder names to emailcommon, which is also in this change.

Also renames emailcommon2 to emailcommon.

This is part of a multi-project submit with
I4a071a07c3e33aaa4ea404eb66a8db1eabc9ef0e and
I5746c0353783f9b29d52d6540472588c6542a6a2.

Bug: 8383232

Change-Id: I6c6eec4f1bcf2abd54c1ed05da1add8d894ee403
2013-03-19 19:45:52 -07:00
Yu Ping Hu 8e2c4056ca Clean up dead code. Should be a no-op for functionality.
Also includes a fix for saving a draft that's already
been saved (used to create a new one).

The following were unused:
- accountIdAddToField
- mailboxIdAddToField
- uisendmail
- uisavedraft
- uiupdatedraft
- uisenddraft

Deleting those also allows us to remove the translation
from the Bundle used by calls to the ContentValues used by
update (since the update paths are now gone).

Change-Id: I87f2875e3272177a128a8ff65541e51b1f2d05fc
2013-03-14 14:40:39 -07:00
Scott Kennedy b34608228f Move notifications to UnifiedEmail
This involves redoing the persistence model, to split general,
account, and folder settings into separate SharedPreference stores.

It also requires some preferences to be moved into UnifiedEmail.

Depends on Ibe2e3f93ec164370535ffc5f5b2409544cc8d36d (UnifiedEmail)

Change-Id: Ie6ec389b5b5d2e7ab1b299d0877811ae716526e2
2013-02-08 09:48:22 -08:00
Marc Blank e714bb9d15 Convert authorities, intents, and account manager types
* Tested ok on wiped Nexus
* Tested ok on S3
* Upgrade verified on Nexus

Change-Id: If5d4ce594f8a309cdb59589d10b1d33f3b79326c
2012-08-31 23:26:36 -07:00
Marc Blank f419287f22 DO NOT MERGE: Move emailcommon2 sources to emailcommon
Change-Id: I06df7e467cd2e0117df8b8db3ddc6ff9da13f1c7
2012-06-28 11:15:06 -07:00
Marc Blank 03cd72805d Revert to old Email app
* These are the last sources in the ICS-MR1 tree

Change-Id: Ida4651bddd92a06a518d00f3e1f275ab3a80c8ae
2012-04-25 13:58:23 -07:00
Marc Blank e2166f7548 Add totalCount to Mailbox; send to UIProvider
Change-Id: If01868eb27a97540683f25148f32b8c41ae59c17
2012-03-10 20:15:58 -08:00
Marc Blank ebb79619e8 Move account delete logic to EmailProvider
* This functionality had to move away from Controller

Change-Id: I557918a325eab8c83a9728fa1ce33dde8b86158f
2012-03-09 12:59:21 -08:00
Marc Blank 06a382f26f Fix up delete to handle trash/drafts deletions
* Also, while we're here, create default "last touched time" for drafts and
  sent so that they appear in the initial recent list

Change-Id: Ie2fe20b34625b5616dac5581f9bbd015f52a82bc
2012-03-08 14:36:26 -08:00
Marc Blank bf5caf97c5 Notify by mailbox, rather than account
* Update EmailProvider, removing two no-longer-used columns in Account and
  Mailbox

Change-Id: Ie0f10eb0ca315d73e82be968f7760a51a239ba3f
2012-02-24 14:51:59 -08:00
Marc Blank 1dc7772d43 Support syncStatus and lastSyncResult in EmailProvider
* Also, trigger a sync on refreshUri

Change-Id: Ia8dee593decfc2101873071ad64fcc3fd1fd5f23
2012-02-22 11:50:18 -08:00
Marc Blank 1aba472486 Remove unneeded logging from EmailProvider
Change-Id: I229c3044566b6067efb7a8a06c10f41dbea3ad5a
2011-08-19 16:56:29 -07:00
Ben Komalo 37a7469716 Hide sync options and search icon when appropriate
- hide sync options for mailboxes that aren't actually syncable
- hide search icon for any mailboxes that don't have any server
counterparts

Bug: 5086134
Change-Id: I60d5e5d1225a946464c5ea273c7d4b9299f433e5
2011-08-07 15:40:12 -07:00
Ben Komalo cb1d65c478 Fix mailbox finding and unit tests.
We seemed to not properly fallback to querying the database if the cache
did not contain a mailbox of a specific type. We may want to consider
caching mailboxes related to PIM data, but for now this is a quick fix.

Also fixes unit tests.

Bug: 5019661
Change-Id: Idcac0a6f15aa7f174890ae586f478fbb8f6e05b7
2011-07-25 16:51:47 -07:00
Ben Komalo 81a153463b Remove "Move" action on POP.
Bug: 5010614
Change-Id: If0a94840e9dc104566ba39d2e3240883dab5bba0
2011-07-20 13:21:06 -07:00