Commit Graph

4076 Commits

Author SHA1 Message Date
Yu Ping Hu 070569b46c Merge "Remove the folder structure daily sync for push accounts." into jb-ub-mail-ur10 2013-07-15 17:54:45 +00:00
Yu Ping Hu 05cf8a1c1f Remove the folder structure daily sync for push accounts.
Turns out that you don't need it -- Exchange has a way to
tell the client when folder changes occur.

Change-Id: If8089d9fe55e7ece407acf2f0dae977dced522b4
2013-07-15 09:29:05 -07:00
Paul Westbrook b2c7bcff78 Set the correct account uri to message
Bug: 9595801
Change-Id: Ie3a92c2194caf77ef6f3286e9dcb43684a0b32f4
2013-07-12 18:15:46 -07:00
Paul Westbrook 8a289cb07c shorten log tag lengths
Bug: 9815409
Change-Id: Ied2ef86ec204d005c246444906d7a385e939043e
2013-07-12 10:27:56 -07:00
Paul Westbrook dbb8b75a4b Fix feedback from Email settings
Bug: 9428466
Change-Id: I6816976b858a6a15da7d643320983208287a463a
2013-07-11 13:13:11 -07:00
Vikram Aggarwal 50f645e019 Parent folder as a URI
Email populates the URI correctly

Bug: 9694857 Populate folder.parent correctly in the provider

Change-Id: Ia509e1dbb2805a752805ba443527c3013715db24
2013-07-03 15:56:58 -07:00
Yu Ping Hu 9c45527779 Allow account setting screen without outbound hostauth.
We have a way to handle lack of outbound host auth, and it's
a legitimate state for Exchange accounts (since it's unused
anyway).

Bug: 8631134
Change-Id: I99863f627c4f364e61f7a4b99dea3e2606a55275
2013-06-27 13:05:18 -07:00
Scott Kennedy 229c070b0b Change the concept of a default account
The user no longer has control over this. Now, the "default" account
(which is only used for prepopulating the name of new accounts is
either the last used account (to be defined), or the first account in
the database.

This removes a setting, and simplifies a lot of code.

We may also want to auto-select the default account when entering the
compose screen from the combined view, but we do not currently have
an easy way to do that.

Bug: 7442992
Change-Id: Iff5bb36d8cbd327334211b670fa4851cbda6b9a0
2013-06-27 10:22:22 -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
Scott Kennedy 1b8e0fa23f Clean up a bunch of warnings
Bug: 9565838
Change-Id: I5e95562bbf463f057cbcc4a9884427a774473b45
2013-06-25 15:34:32 -07:00
Yu Ping Hu 038924037b Fix mailbox sync options.
- Change mailbox sync interval to be a boolean.
- Decouple Inbox settings from account settings.

Change-Id: Id02d43b281f323ca4db499ce97e8f4bb6d82c2bb
2013-06-24 19:38:35 -07:00
Andrew Sapperstein 478417a794 Support eml attachments in email.
Change-Id: I76274540d00a292d5a8f777d75d8e9f7b2ef3a51
2013-06-21 11:38:13 -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
Mark Wei 650f50023a Merge "Fix IMAP attachments REDOWNLOADING." into jb-ub-mail-ur10 2013-06-20 00:42:13 +00:00
Mark Wei 8f474dc02f Fix IMAP attachments REDOWNLOADING.
Previously, if you clicked Download again, you will never be able to view that
attachment again.

Change-Id: Ie944becaf8c89a1a27b8625af4795550e9213f5e
2013-06-19 17:35:37 -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 f44697e158 Merge "Return null instead of crashing when querying a bad folder." into jb-ub-mail-ur10 2013-06-19 01:24:35 +00:00
Yu Ping Hu 70500d2253 Return null instead of crashing when querying a bad folder.
Bug: 9250557
Change-Id: Ic0074fa1f6db53a7495c7de48a8f42158a0ea1d9
2013-06-18 18:13:45 -07:00
Paul Westbrook e7d539ddf9 Update the signature summary
Bug: 9480853
Change-Id: I8996efa268c906485ee1d5cfcf0f883d40927009
2013-06-18 16:33:20 -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
Yu Ping Hu 21b2522d7f Remove auto sync windows.
Also includes other DB upgrade code.

Bug: 8668336
Bug: 9226612

Change-Id: Id9664fd8cda466ec34862a793e41cbcce78efb4c
2013-06-14 18:26:42 -07:00
Paul Westbrook 525e8ad321 Move support for settings menu to UnifiedEmail
Move the base settings menu to UnifiedEmail

Bug: 9393150
Change-Id: Ifa69125d84802a0d7dd2275e4704ec7a4d1fb2f1
2013-06-12 23:52:43 -07:00
Scott Kennedy 380985add9 Merge "Move to Inbox" into jb-ub-mail-ur10 2013-06-12 20:02:12 +00:00
Scott Kennedy 1079b6e962 Move to Inbox
Add a new Account setting field: Uri moveToInbox
This contains the Uri to use for the "move to inbox" action, which
may differ from defaultInbox.

There is no Move to Inbox in Email right now.

Bug: 9256654
Change-Id: I7c81c8115eda83123a09a9b7da7adf97a3c79964
2013-06-11 19:56:44 -07:00
Yu Ping Hu 6fadd5a0bd Add some null checks.
Bug: 9393662
Change-Id: I8c47b701062fb91e0e622644a26b470e78f62014
2013-06-11 16:56:06 -07:00
Paul Westbrook 38f22dbf08 Use "show pictures" code from UnifiedEmail
Bug: 9320770
Change-Id: I701a93e2f09b8405a2c4bc56f7793f5abadbcd1e
2013-06-07 18:09:57 -07:00
Paul Westbrook 5a3fe57f4e Fix logging crash
If the string contains a character that is intrepreted by the
string formatter, this would throw an exception

Change-Id: I60cccb539bf197fa555d8d1f0fa1bdca3e07114e
2013-06-06 17:20:52 -07:00
Paul Westbrook 555bd3c0b7 Don't show search folder
In folder lists, don't show the search folder

Bug: 9227357
Change-Id: Ic0b8a39929f6d2528f445d3746c4eb1915275593
2013-06-06 11:06:38 -07:00
Scott Kennedy 4c47dadf18 Merge "Unify LogTag" into jb-ub-mail-ur10 2013-06-06 18:03:53 +00:00
Paul Westbrook c1d56928b2 Add a limit to the Conversation query
Bug: 9294348
Change-Id: Ifedfe657f205adb1c8a12382b908f4b3b4346500
2013-06-06 10:08:22 -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
Andrew Sapperstein 6be411edd0 Refactoring to support eml viewer in UnifiedEmail.
Moved two files out of Email into UnifiedEmail and
removed their dependencies on EmailContent. As a result,
those classes now return the data directly via a data only
class.

Change-Id: Iaf0618dd6879c9dc2a41943d3d15428904b65768
2013-06-04 15:37:40 -07:00
Paul Westbrook 9d5ed9e7a8 Added logging, and switch to AsyncTask
Bug: 9111546

Change-Id: I287b07346bb1729c7a1afadbc0c94a0d37df92f8
2013-05-29 20:17:17 -07:00
Andrew Sapperstein bc7cd75e9a Prevent duplicate inboxes after upgrade.
Previously, we were not properly handling the
case-insensitive INBOX mailbox type. We are now
upgrading properly. Fixes b/8701883.

Change-Id: I61be5159e23dc3e9578e577e33bc00a63f56b525
2013-05-29 18:10:59 -07:00
Scott Kennedy ddca2a0dcb Show unread count when virtual folder is selected
We were not populating the unread count for virtual folders in one of
the two code paths, which resulted in the count disappearing from
the folder list whenever that folder was selected.

By moving the count code into getVirtualMailboxRow(), it will always
be called, so the count will always show up.

Change-Id: Ibb947ec6ed761babbcf162dbab38f44a6150d5e3
2013-05-28 14:59:22 -07:00
Yu Ping Hu fb6a74b5e0 Merge "Handle redirection during validation." into jb-ub-mail-ur10 2013-05-23 22:52:39 +00:00
Yu Ping Hu c28347552e Handle redirection during validation.
This allows the validator to tell the app that
it should use a different host.

Change-Id: Ie42c32aa7aea83e4d95d2b82b88225036b2407a9
2013-05-23 15:11:25 -07:00
Andrew Sapperstein e43224f7ae Merge "Return raw folder in respond()." into jb-ub-mail-ur10 2013-05-23 19:02:24 +00:00
Andrew Sapperstein f3618c2320 Return raw folder in respond().
To get the name of the folder, we need
the conversation cursor's respond method
to return a Folder object. Now it does.

Also refactored a getFolder method in
WidgetProvider to be in EmailProvider so
anyone can use it.

Change-Id: I55ee180955ff4f4be7012ed6b5dda596e8e9d236
2013-05-23 11:55:43 -07:00
Yu Ping Hu 7283aea81c am 8b4f04a5: Merge "Auto-advance policy accept by triggering syncs." into jb-ub-mail-ur9
* commit '8b4f04a5ab48ab76a131137516edb8abab63b6d2':
  Auto-advance policy accept by triggering syncs.
2013-05-23 10:40:05 -07:00
Yu Ping Hu bd1e0b79e4 Auto-advance policy accept by triggering syncs.
Exchange goes through multiple steps to set up accounts.
Each step requires a sync request to occur, so this change
requests syncs as necessary.

Bug: 9074056

Change-Id: I0f35a06409c6a77c82d004958ecc323cf8030ab4
2013-05-23 09:52:07 -07:00
Scott Kennedy d8302b01fa Ensure notifications get cancelled when necessary
There were a few places calling the old notification code to cancel
notifications. These calls were completely unnecessary.

Also, when an account is removed, we now clear all notifications that
may exist for that account.

Bug: 7935576
Change-Id: I58f7e194c3f9a928e932b3b1b87475e7d3653b6a
2013-05-22 18:36:07 -07:00
Mark Wei 29dc837d80 Fix flashing conversation list reloads.
The MergeCursor was not setting the notification uri and observers correctly.

Bug: 9051928
Change-Id: I920cd836aeb6fe550bf05a7e21bc4378ef9772a3
2013-05-21 12:49:25 -07:00
Yu Ping Hu 0d5e21d0fc Read protocol version from validation bundle.
Exchange used to just re-check version on first sync.
Version is known during validation so might as well use it.

Change-Id: I004fe671a1ad30a7cfe0a0659b74b20ee2136771
2013-05-17 17:30:43 -07:00
Yu Ping Hu eb23229030 Always request a folder refresh for new accounts.
Change-Id: I396293f39b7f24ebf67e7619ce19765e1229f56b
2013-05-17 12:10:10 -07:00
Andrew Sapperstein 53836e572e Enable "move to" from trash.
Fixes b/8986915. Forgot to set a flag in the
FolderCapabilities.

Change-Id: I202e46d89fe5705e3ddd05b1fbd0c8cd9f8fae0d
2013-05-16 17:55:42 -07:00
Andrew Sapperstein 5f1dbb7e66 Merge "Using proper Unread icon for unread "folder"." into jb-ub-mail-ur9 2013-05-16 18:55:50 +00:00
Andrew Sapperstein 7e75311926 Using proper Unread icon for unread "folder".
Fixes b/8967972.

Change-Id: I1089fdeac5803fd6f9bed19d1c22d0629814ba87
2013-05-16 11:53:23 -07:00
Yu Ping Hu 67b38031ab Merge "Changes to support cleaving sync out of ExchangeService." into jb-ub-mail-ur9 2013-05-16 18:43:26 +00:00
Yu Ping Hu 7c3f85885c Changes to support cleaving sync out of ExchangeService.
Change-Id: Idbfff4ddc8fca4829228d04816d40a4ab9639382
2013-05-15 15:04:59 -07:00
Andrew Sapperstein fff905416f Show "no messages" when list is empty.
Fixes b/8547230.

Change-Id: I7d9d00c9448f1222d38a1a6406709818b2523ceb
2013-05-15 12:11:42 -07:00
Andrew Sapperstein b8d7d8d31d Fixed label icons when selected.
Fixes b/8599310. Using selector xml drawables
to properly get the right assets for the folder labels.
Also did some renaming/moving cleanup.

Change-Id: I3b5ddc9fb9da239131405880e637fa1df2c99ea6
2013-05-14 14:30:56 -07:00
Yu Ping Hu f55972ecd8 Add more sync status callbacks.
Change-Id: I77e8b122474d5240ad5aaed7556471263a05e6de
2013-05-08 10:42:31 -07:00
Paul Westbrook 968a2fe780 Return full email address in conversation
Bug: 8850702
Bug: 8737081
Change-Id: I7d267e0cca243baf174c6cb61c887538e5e3bb54
2013-05-07 11:00:02 -07:00
Scott Kennedy bed61a78a0 Support the "Reply all" setting
Bug: 8571631
Change-Id: I52c976f7a8247d53908d90569a24d0573dd4508f
2013-05-06 19:58:19 -07:00
Scott Kennedy 4994e7ca50 Reply-all migration
Bug: 8546815
Change-Id: I6b41aee84f0e1dfdbed4b7b2e843b6268659ee20
2013-05-03 18:49:51 -07:00
Yu Ping Hu 71737836e6 Add call for sync status updates to UI.
Change-Id: Ib91284b423cf88e8feac3b40d13627d26ccc7de7
2013-05-02 18:53:17 -07:00
Yu Ping Hu 1484c6663d Code cleanup.
- Cleanup sync adapter to not have statics & locks.
- Remove some dead code.

Change-Id: Ia310d32b93706dc3742ccee74e5b751174280488
2013-04-30 14:21:19 -07:00
Yu Ping Hu 5b52817243 Merge "Use system SyncManager for Exchange." into jb-ub-mail-ur9 2013-04-26 18:08:00 +00:00
Alice Yang 6929654a0d Remove checkboxes from Email
Change-Id: Ie2338cddcf15a278622f72e4827e6b160e16912f
2013-04-25 22:13:29 -07:00
Alice Yang 81c1b3ee2f Sender images in email
This is the minimum change to not break the build in Email when CL
for removing checkboxes is submitted in MR2.
I'm still investigating why contact images aren't showing up in Email and
will follow up with a fix.

Change-Id: I814ed2b0b0a468ee465e57c47c6c7248f4afdbbc
2013-04-25 20:28:31 -07:00
Yu Ping Hu 9e7f5a2a33 Use system SyncManager for Exchange.
Change-Id: I77e4e75c94c532d22a28cf97e6f55f1259b8bdde
2013-04-25 14:03:00 -07:00
Scott Kennedy c726d4fa6c Add "Reply all" setting to tablets
This controls the notification action on tablets.

Change-Id: I0b8df2ded371820f0dada3f1b11cebad462962ed
2013-04-24 18:15:19 -07:00
Andrew Sapperstein 156a9bde06 PreferenceMigrator force commits pref upgrades.
Now, when PreferenceMigrator.migrate is run,
we forcibly call commit after the VersionedPrefs
object is updated (whether MailPrefs, AccountPreferences
or FolderPreferences). This commit applies the change to
Email2. Should fix b/8640441 and b/8520847.

Change-Id: I9a014c1c4bd35aa2ea8e268fec9a050d47e4d732
2013-04-24 13:38:08 -07:00
Scott Kennedy 643846abbd Settings changes
Bug: 8685202
Change-Id: Ica781557b91e5ed43221f6e28b9d65cbb044ea55
2013-04-23 13:12:31 -07:00
Andrew Sapperstein 625409b169 CL to support method signature change.
Helps fix b/7923968. This is just a one-line
change. The real change is in the UnifiedEmail code.

Change-Id: I60808c0265e911394cbffa92214d10626769ca9a
2013-04-22 13:59:16 -07:00
Yu Ping Hu e669f28b08 Fix periodic sync (for POP/IMAP).
Periodic sync management was wrong in at least two ways:

1) Periodic syncs were scheduled as a side effect of
   performing a sync, so changing the sync interval setting
   would not do what you expect.
2) Performing a manual mailbox sync would schedule a
   periodic sync on that mailbox.

This change removes the side effect from sync, and instead
actually responds to updates to the sync interval by
removing the extra syncs and updating just the account sync.

Bug: 8666490
Change-Id: I3f4a3fb7044c408578f0dc75ccb6c5bb176bfc0b
2013-04-21 11:33:52 -07:00
Yu Ping Hu 50d5152f54 Merge "Code cleanup." into jb-ub-mail-ur9 2013-04-19 23:16:00 +00:00
Yu Ping Hu 0eb47994a3 Code cleanup.
- Refactor EmailProvider.call
- Remove unused import

Change-Id: I9f0ae35256856a9cd6ea015348d49fcbb6fa8b0f
2013-04-19 15:59:27 -07:00
Mark Wei 3a82ad5992 Fix migration from Email1 to Email2 when using combined inbox.
Bug: 8578254
Change-Id: I2afb7e145664c1e6d10c0cfbf654d835fec8c9f1
2013-04-19 15:07:28 -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 9a2686afa2 Improve POP sync.
- Set socket timeout as soon as you open it. This was how
  IMAP worked, so I just moved the call up one level. This
  should help one of the sync forever scenarios.
- Simplify the SQL query for getting a Mailbox.
- Try to load messages that failed to load last time.
- Always close the connection to the remote folder.
- Don't try to be too clever in fetching the body.
  This needs to be fixed later for attachements, but for
  now seems to work better and will let me get more testing.

Change-Id: I91b6a6f2a2846b34b1a0c50eb4eb37fc947389ce
2013-04-17 10:54:33 -07:00
Scott Kennedy e0d4cab353 Populate the account object with the type
This is needed for prioritizing contact results

Bug: 8587925
Change-Id: I093f0914060a01f37b175ae5877b27e0e16e9eaf
2013-04-15 13:22:27 -07:00
Yu Ping Hu f9fd4b6bb4 Remove spammy log message.
We don't have special MIME types for all possible queries.
It's only an error if the matcher doesn't know about it at
all, which is handled by findMatch, so we just return null
here (same as with Gmail).

Change-Id: I7061e25b8fd4543c41f62188cb90712353a64779
2013-04-12 16:19:58 -07:00
Yu Ping Hu 9b040bde34 Base64 the folder persistent id.
Bug: 8596345
Change-Id: Ib7025fa54abb12f7c65628639819d06fb530c7ed
2013-04-11 21:42:23 -07:00
Yu Ping Hu 22130ad565 Sync folders during account sync.
Previously, the folderlist itself would only sync when there
was no inbox, i.e. at account creation time. Now any sync
that's not a mailbox specific sync will do it.

Change-Id: If7c446cd2e193ed6e1a4abd3fdde0d5748371ba5
2013-04-11 20:39:36 -07:00
Yu Ping Hu 64cc777f8b Autosync stale mailboxes when switching to them.
"Stale" is currently defined as "it's been 5 minutes since
my last sync".

Also includes a small refactor so that uiloadmore doesn't
load the mailbox from DB twice.

Bug: 7100372
Change-Id: Ib31aa211fe2ab790044beb7bc7d2fdcccf595171
2013-04-11 18:01:29 -07:00
Yu Ping Hu 4b0e25898e Fix checkbox option fetch for combined view.
Change-Id: Ie0679ce00ee0558cccc8e10c9346dd730ce08a33
2013-04-11 15:42:09 -07:00
Alice Yang 54cf4b9d8c Merge "Checkbox vs. sender image setting" into jb-ub-mail-ur9 2013-04-11 21:41:51 +00:00
Alice Yang 9f1cff0659 Checkbox vs. sender image setting
Replace the current "Hide checkbox" setting with a tri-state setting with
choice of:
- Show checkboxes
- Show sender image
- Show neither

Bug: 8512959

Change-Id: Ifa233b6d65f8c37388edeed71dbfbfdf1295d6fc
2013-04-11 14:16:01 -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
Paul Westbrook 0c06a7cf99 Fixed mis-located cleanup code
Bug: 8565783
Change-Id: Iab06411cc85cd4958db574ec52eeebb7457c980f
2013-04-10 00:34:04 -07:00
Vikram Aggarwal 6b88a2471f Allow queries in folder URIs
As a result of a previous change, we are appending application version
to the end of the folder name.  This breaks the EmailProvider's
expectation about folder URIs.  So instead of using just
uifolder/<number>, allow for uifolder/<number>?<appversion query>

getPathSegments().get(i) will still return the path segment without
the query, so the folder ID gets resolved correctly.

The previous change:
https://googleplex-android-review.googlesource.com/#/c/281416/

Bug: 8435074 Not able to access Exchange inbox and combined inbox

Change-Id: I7b9ffad9b5510d1a08a29e2a21aacb091d4330a6
2013-04-09 15:08:11 -07:00
Paul Westbrook 7b423bf136 Remove waitForDebugger call
Bug: 8558839
Change-Id: Ie9f351b119620016e9a46c5bf389fdeb75c77382
2013-04-06 12:35:39 -07:00
Yu Ping Hu 2930476051 Reorder the folders in combined view.
Inbox should go to top.

Change-Id: I90c55952aaa3955adfd6d08a12a568bfb192c730
2013-04-05 16:35:51 -07:00
Paul Westbrook fcddd014da Merge "email: "Exchange Services has stopped" - Rain of Exchange Javacrashes" into jb-ub-mail-ur9 2013-04-05 22:35:37 +00:00
Yu Ping Hu 1389f0ed03 Merge "Add virtual mailbox for all unread messages." into jb-ub-mail-ur9 2013-04-05 22:25:56 +00:00
Emmanuel Berthier 689efab2b1 email: "Exchange Services has stopped" - Rain of Exchange Javacrashes
Cleanup some nasty records containing NULL fields.

Change-Id: Iec5e7e1bebc4beee8fa010c3f9c9ee723fd2cd83
Author: Emmanuel Berthier <emmanuel.berthier@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 60461

cherry-pick of https://android-review.googlesource.com/#/c/47571/1
2013-04-05 15:22:14 -07: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
Paul Westbrook d402c890dc Fixed make POP and Imap more locale safe
Cherry-picks from:
https://android-review.googlesource.com/#/c/42334/
https://android-review.googlesource.com/#/c/42332/

Change-Id: I557c3d8c725cf6dc4f13f227dcec63864ab5db67
2013-04-05 13:57:51 -07:00
Paul Westbrook 9fd03edb83 Merge "avoid cursor leak in email provider" into jb-ub-mail-ur9 2013-04-05 20:49:09 +00:00
Yoohyun.choi 89c74e89e5 avoid cursor leak in email provider
When cursor is done, the cursor must be closed to avoid cursor leak.

cherry-pick of https://android-review.googlesource.com/#/c/52910/
Change-Id: Iaaffed2c4e90dc4b17ae55fcedb242bf890b3dd5
2013-04-05 13:45:56 -07:00
Jack Bates 4fd97a3050 Fix SMTP RFC violation for better interoperability
Space after colon violates RFC 5321 (and RFC 821): "Since it has been a common
source of errors, it is worth noting that spaces are not permitted on either
side of the colon following FROM in the MAIL command or TO in the RCPT command"

Change-Id: Ie5330bf2bd01cd8f734134dadd742cf16df70d7a
Signed-off-by: Jack Bates <jack@nottheoilrig.com>

cherry-pick of https://android-review.googlesource.com/#/c/32640/
2013-04-05 13:42:13 -07:00
Paul Westbrook 391a7fc0e9 Support legacy shortcuts
We need to support shortcuts that were created with previous versions
of Email

Bug: 8530220
Change-Id: I9e2a44b561f5617ffa954af37a9e78a95400f7dc
2013-04-04 02:45:17 -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
Paul Westbrook d1a87bc02d Fix IMAP sync with Arabic language
Email shouldn't rely on the the default locale.
See: http://developer.android.com/reference/java/util/Locale.html#default_locale

Bug: 7138507
Change-Id: Ia2c6eccc6dee011f4e7e7c663a0328d4fd76131b
2013-04-02 11:36:11 -07:00
Yu Ping Hu de4c230f00 Exclude not fully loaded messages from uimessages queries.
Bug: 8370633
Change-Id: I5643454333b490bb1a988efb7b59e20b18fa67f4
2013-04-01 20:08:30 -07:00
Yu Ping Hu 46d6a4a7cb When loading messages, use left join for Message and Body.
Existing inner join means that a Message without an entry
in Body table cannot display correctly, even though this is
a potentially legitimate state.

However, because the MessageCursor for Email doesn't read
flagLoaded at all, this change actually causes another bug:
if you go to a partially loaded message, it will show as
blank with no load indicator. Fixing b/8370633 will mask
this by not letting you get in a situation where partially
loaded messages are shown.

Bug: 8512030
Change-Id: Ie2e365e7e5df3959115ed299d1a7f03aa1d7af79
2013-04-01 18:17:25 -07:00
Yu Ping Hu 3bef153c9c Merge "Improve error logging for mailboxNotification." into jb-ub-mail-ur9 2013-04-02 00:36:48 +00:00
Paul Westbrook 11472650d1 Fix apk attachments
Bug: 7585865
Change-Id: I20191523377d99472e333dece4d727415f97c67a
2013-04-01 17:20:27 -07:00
Paul Westbrook 3767da5d26 Add capabilities for search folder
Bug: 6693452
Change-Id: Ib55fca4f883a699eabdaabf35568bffa055d556f
2013-03-31 12:00:14 -07:00
Yu Ping Hu 7cc82371ec Improve error logging for mailboxNotification.
Change-Id: I5b16ac46ce8cdd6e8f791c9cea7d7ead7e053bdc
2013-03-28 19:10:23 -07:00
Yu Ping Hu c534638b7a Disable notification prefs until folder prefs are loaded.
Bug: 8485354
Change-Id: Id56c2634a16274e9340ad6ecb96661ee8a489d49
2013-03-27 17:40:38 -07:00
Yu Ping Hu 1dd937bf18 Prevent NPE when getting a bad mailbox id.
The mailboxNotification query apparently can return bogus
mailbox ids. This underlying bug still needs fixing.

Bug: 8482721
Change-Id: Icfbd0d986ab32fe878a0dbe09a3276322c75cafe
2013-03-26 15:00:30 -07:00
Paul Westbrook 28a344042d Prevent NPE
Also add additional logging for this case

Bug: 8372753
Change-Id: I87aa9ee46f0ca866745d62d27f4b40913f2e9b97
2013-03-22 18:21:19 -07:00
Yu Ping Hu 861c5c8c9e Guard against potential NPE.
Change-Id: I379da1f478b1b1fd1e488dbeff249cc10e3d48d5
2013-03-21 19:25:14 -07:00
Paul Westbrook 5a3aebbd2d Fix problem with sending attachments in Exchange
The problem was that when the attachment was attempted to be opened
from the Exchange process, it didn't have access to the cached file.
Instead, use a content provider uri to reference the cached file.

Bug: 8400456

Change-Id: I80abd66642e938cf09f73bf0e9bd049aa8d7ba1d
2013-03-21 17:34:19 -07:00
Yu Ping Hu 68a8e21248 Merge "Always create system folders during sync." into jb-ub-mail-ur9 2013-03-21 16:05:03 +00:00
Yu Ping Hu 8a11cb8fd1 Merge "Always show the starred folder." into jb-ub-mail-ur9 2013-03-21 16:04:53 +00:00
Scott Kennedy f16a7612c0 Exclude all inbox labels when we're viewing an inbox
Bug: 8426563
Change-Id: I7707c9ebf9ebcb73be73ef82f5f2212514671bfe
2013-03-20 17:51:59 -07:00
Yu Ping Hu a5a963321d Always show the starred folder.
Bug: 8383232
Change-Id: I8a5fa0dbdd9f4f2000c5b7d3347eb4946af0ae80
2013-03-20 15:34:56 -07:00
Yu Ping Hu 2192bf01e0 Always create system folders during sync.
Change-Id: I8ff6eb4f65d4207d7a2768c5fd837fad8cd47269
2013-03-20 15:23:51 -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 91107a4c56 Remove useless UI notifications in uiUndo.
The uris supplied for these are bogus (lack IDs), and at any
rate the actual undo itself should notify the UI. (That's
currently broken, but not for want of trying, but the point
is that needs to get fixed anyway.)

Bug: 8373349
Change-Id: Id0f4e9fa45f2ece42d07f1f350d841f00270a8d9
2013-03-18 14:41:24 -07:00
Yu Ping Hu d0e7d88f43 Fix undo to use the correct URI.
Bug: 8373349
Change-Id: Ia23b60a1f82be16cb48afe5cf239e1c588b192a1
2013-03-15 19:32:32 -07:00
Yu Ping Hu 3e88d65aa8 Fix inboxes in POP for non-english.
Same as I27b422b4b9a3568c899beda41c96e61eb77c4ad3
but for POP.

Bug: 8393126
Change-Id: Ifa7ef3aa4080ec4c39309f988f041344fc4e8b54
2013-03-14 20:29:10 -07:00
Yu Ping Hu b3b47ef971 Merge ""Fix" Inboxes in non-English languages for IMAP." into jb-ub-mail-ur9 2013-03-15 02:42:29 +00:00
Yu Ping Hu 5187e702d6 "Fix" Inboxes in non-English languages for IMAP.
Without this change, languages where the inbox is not named
"Inbox" will never initialize IMAP accounts correctly.

This change "works" because
LegacyConversions.inferMailboxTypeFromName matches against
server name. Obviously this code's bad and I should feel
bad, but for now this change at least makes the app usable
in other languages and leaves the code in the simplest state
for fixing later.

Bug: 8393126
Change-Id: I27b422b4b9a3568c899beda41c96e61eb77c4ad3
2013-03-15 02:01:22 +00:00
Paul Westbrook 5ed8b266a4 Fix some problems with move message
Make Email respect the accepts moved mail flag

Don't throw an exception when receiving on the
folders_updated column

Bug: 8370675
Change-Id: I92c630577e6f572361bbaf68d8e5d0bfb6204951
2013-03-14 16:06:11 -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
Yu Ping Hu a6cd7cbd63 Merge "Fix IMAP send by ensuring system mailboxes exist." into jb-ub-mail-ur9 2013-03-14 17:17:54 +00:00
Yu Ping Hu f7055e2618 Fix IMAP send by ensuring system mailboxes exist.
This is a quick fix to get it working ASAP, I will improve
how system folders are created when handling b/8383232.

Bug: 8307247
Change-Id: I6ea24ea756911c60d4eca69ce65d27dff33850c8
2013-03-14 17:07:00 +00:00
Alice Yang 700fb3c23d Merge "Revert "Change "hide checkboxes" to "show checkboxes""" into jb-ub-mail-ur9 2013-03-13 21:31:30 +00:00
Alice Yang a833b36ec2 Revert "Change "hide checkboxes" to "show checkboxes""
This reverts commit 5742d44917.

Bug 8370186

Change-Id: Ie15b7c30aaba8df8678d15e19dcd38fddea6de13
2013-03-13 14:18:19 -07:00
Paul Westbrook 88c80b775b Load replyall setting
Bug: 8374501
Change-Id: Ibf01a9c27ad05e3d6c1b172a255299d8af3b69ea
2013-03-12 21:28:26 -07:00
Paul Westbrook fdc5e52ef9 Merge "Simplification of app initialization" into jb-ub-mail-ur9 2013-03-12 22:24:40 +00:00
Yu Ping Hu 9d91dd8023 Specify correct sync extras for user-requested syncs.
BUG: 8364227
Change-Id: Icfc97c92e5ecc9c2abd83b73cf67a5e10408cede
2013-03-12 12:38:01 -07:00
Paul Westbrook 06c358dfee Simplification of app initialization
Specify a account query uri in a resource, and remove the old receiver

Change-Id: Ia04dccfc95e0bb1854bba2e6f51e2de1546d72ce
2013-03-11 23:48:44 -07:00
Paul Westbrook 5a3d863a43 Add support for feedback
Change-Id: I6de8c0117f79c0be05d3db2fc108f8bf61415783
2013-03-08 17:15:00 -08:00
Paul Westbrook 95bb350f38 Fix NPE when adding account with security policy
When adding an Exchange account with a security policy, Email
generates a notification to let the user enable the policy. The
code that generates the notification attemptes to load the folder
as part of the base notification.  Before the account policy has been
configured, it isn't possible to load the folder.  We need to handle
a null folder when generating the notification

Also, imporoved the logging when an exception is thrown from the
PolicyService

Bug: 8341882
Change-Id: I33ff57adc3c130e8318910e352146b8ea56f9a2c
2013-03-07 23:00:47 -08:00
Scott Kennedy 1cea05ac37 Merge "Make widgets work again" into jb-ub-mail-ur9 2013-03-08 01:45:22 +00:00
Yu Ping Hu 6967b6b6bc Merge "When folder is changed, also update conversation list." into jb-ub-mail-ur9 2013-03-07 19:44:50 +00:00
Scott Kennedy dfd2c87740 Make widgets work again
We can't send Folder parcelables to RemoteViews, so let's just send
what we need: two URIs and a String.

Bug: 8330949
Change-Id: Ic3f272e1bae4530cdc7776fd88eeb7bcb1a7dae3
2013-03-07 11:00:43 -08:00
Yu Ping Hu fc0dae9cd7 When folder is changed, also update conversation list.
Also add the folder's total count to the extras for the
conversation list cursor.

BUG: 7480726
Change-Id: I3215fed561deb8430fd6d6c680bdb44ca87cc162
2013-03-06 19:01:41 -08:00
Paul Westbrook 32881e8dd3 Fix NPE after migrating older account
Change-Id: Ifeb3b1853ce3efd725227941103d29a00bc14fc2
2013-03-05 14:07:47 -08:00
Paul Westbrook 9a95253846 Cache attachments on send
Cache attachments in a email directory when sending to allow sending
to succeed when the content provider has a permission

Bug: 7381557
Change-Id: Icf9faead2048de237228625f998b42feade48978
2013-02-27 09:43:31 -08:00
Paul Westbrook 3e2fdd33e3 Fix account creation
Notifications were not being sent on account additions,
so the UI would reprompt to add an account, after an account
was added.  Now, the appropriate notifications are sent.

Also, fixed some cases where try/finally blocks were not used
to ensure that cursors were being closed.

Change-Id: If65934a34d995471fd5102fbe7e8cacbed5aae44
2013-02-26 12:04:29 -08:00
Paul Westbrook 82fef2b331 Remove usage of deprecated field
Change-Id: I6c2dc897e0389023f16c0d4887ee9489ebba4cd8
2013-02-22 17:07:01 -08:00
Mark Wei ffa3370b39 am ea2edb63: Set MIME type correctly on drafts when content provider does not provide it.
* commit 'ea2edb637036a7368b6ef82a0aafdb1a790e26e9':
  Set MIME type correctly on drafts when content provider does not provide it.
2013-02-22 15:50:45 -08:00
Paul Westbrook 7401a82634 Fix suggestions from last CL
Change-Id: I838a408d28b5427f591e8e453008d9945144ff21
2013-02-22 14:40:14 -08:00
Paul Westbrook e04b736866 Remove deprecated fields/members
Change-Id: I74d5f2eb4ed778f0590a3c935e6b79c335a3bdd7
2013-02-22 12:50:11 -08:00
Paul Westbrook 779fe02003 First part of switching Email to use ContentResolver#call
This CL includes the call() support.  Subsequent CLs will remove the
deprecated UI provider uris, will add attachment caching to Email

Bug: 7381557
Change-Id: Iff59c7c0503c6e9ccda1d15954f72ffa78331b4e
2013-02-22 10:09:03 -08:00
Mark Wei ea2edb6370 Set MIME type correctly on drafts when content provider does not provide it.
Bug: 8235172
Change-Id: Ia8bc575fb902de882dfbba3bfc7cd3acb625ce2c
2013-02-21 18:10:10 -08:00
Yu Ping Hu 512433135c Merge "Fix how visibleLimit for a Mailbox is set." into jb-ub-mail-ur9 2013-02-16 03:01:08 +00:00
Yu Ping Hu 66eef4565d Fix how visibleLimit for a Mailbox is set.
- Make sure visibleLimit stays <= totalCount.
- Don't reset it to 0 every time user enters a folder.

Also sets Folder.totalCount = Mailbox.folderCount
(rather than Mailbox.messageCount).

BUG: 7480726
Change-Id: Iae084d9445f483dca2b1da052ffd4dd7d091c6f6
2013-02-15 17:02:40 -08:00
Scott Kennedy 2f9c66d08b Use swipe preference for archive/delete action
Since some people prefer delete over archive, we will use their
conversation list swipe preference to determine whether to show
a "Delete" action or an "Archive"/"Remove label" action. "Delete"
will be shown if they have selected "Always delete"

UR9 version of I4eb0d408474a9f613cc4267c3851cc7277a22ebd

Change-Id: Ia2f1382b88c1ee6f64e864cb8b780d02821b673d
2013-02-14 14:46:02 -08:00
Vikram Aggarwal 132a3f0977 Merge "Add user assignable category for mail foldders if it accepts moved messages" into jb-ub-mail-ur9 2013-02-11 17:03:46 +00:00
Rohan Shah 5ba32cc2b9 Add user assignable category for mail foldders if it accepts moved messages
Email requires a user assignable category in the case
the user is moving labels/folders from a category the
user should not be allowed to view (i.e. sys labels).

Change added flag under function where if it allows
moved messages, it will allow the user to assign
there as well.

Bug: 8157593

Change-Id: Icc8a5d4587ef9180d32207613da4f31ddc8854f1
2013-02-08 11:19:11 -08: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