Commit Graph

206 Commits

Author SHA1 Message Date
Marc Blank
70bbe5ec3c Add columns to Attachment for UIProvider use
Change-Id: I7f85431f409dbd6a5bd6d111b18d1fc89c00b9b2
2012-03-07 13:10:23 -08:00
Marc Blank
54c26f9d32 Improve hashCode() for Address
Change-Id: Ifa15e57d8b7ff83511aab853dc0a5da1eb14892d
2012-03-04 17:31:38 -08:00
Marc Blank
0ba6b91842 Give Address a hashCode() method
Bug: 1858468

Change-Id: Ic91292c7ab7cf8b42cdecd54fa2d4faf91b2ff4d
2012-03-02 15:18:57 -08:00
Marc Blank
9a5e2a798e Fix clearing of mailbox notifications
Change-Id: Ieb98a8908ec067229dd449790da55085585ef17b
2012-02-26 12:52:57 -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
272d22d641 Add last sync result definitions to EmailContent
Change-Id: I43ea9a9ed3e1982610443887298d54654deb01b8
2012-02-23 10:28:36 -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
4f813fb129 Convert POP3 to service
* Remove MessagingController and (almost all of) MailService

Change-Id: I8953b58b237de6a71fda770f1727bd94081fec55
2012-02-16 10:27:00 -08:00
Marc Blank
c84467afe1 Start of IMAP conversion to Service architecture
* Handle startSync and loadMore
* Use SyncManager rather than MailService for periodic sync
  and upload sync
* First of many CL's to disentangle sync from UI
* Note that the large majority of this CL is a refactoring
  of IMAP specific code out of MessagingController and into
  ImapService; MessagingController will eventually be
  removed entirely from the app, as will much of Controller

Change-Id: I13546d0694479b33cf93c25920dedc1d38227f6c
2012-02-13 11:04:56 -08:00
Marc Blank
87d7a60417 Handle update of draft
Change-Id: I15c2b2b85afeff19e4ae7520c36a6119ab1e5cca
2012-02-03 09:51:07 -08:00
Mindy Pereira
b057793bf2 Remove second copy of apache code. Depend on unified email for these classes.
Change-Id: Ibe3e18b8e38389bff7f0e3a3479b660b97f94c7e
2012-01-30 12:50:04 -08:00
Marc Blank
36ed276f7a Store UI-friendly addresses in EmailProvider database
* Currently, we store a generally incompatible packed string format
  for to, from, bcc, cc, and reply-to columns
* Change this to UI-compatible, comma-separated RFC822 strings
* Upgrade database to use new format

Change-Id: I42c01d72b49531c4324d3956edf5ff362d5c9120
2012-01-17 13:11:45 -08:00
Marc Blank
fd81e19779 Don't save Policy with Account
Change-Id: Ib3601daee8780640a07db573f623e99279c9f9b1
2011-11-21 13:04:26 -08:00
Andy Huang
f20f3e216f am 56d6f4a6: Merge "Style cleanup in email message header to make it more like Gmail" into ics-mr1
* commit '56d6f4a6f13b53051d17579c54cebe0372515f3d':
  Style cleanup in email message header to make it more like Gmail
2011-11-03 05:17:42 +00:00
Andy Huang
358a815701 Style cleanup in email message header to make it more like Gmail
Linkify email addresses in expanded message details
Remove divider line in upper header on phone
Embolden sender name
Twiddle expanded details line spacing and padding to match Gmail
Add space char to collapsed details recipient enumerator (comma)

Bug: 5520692
Bug: 5520787
Change-Id: Iad4a265168d111aa01654a33a9a14f7968fc3181
2011-11-02 15:50:00 -07:00
Marc Blank
4317ff162e am dea198bb: Add utility to determine if account can\'t auto-sync due to roaming
* commit 'dea198bb041754745c3b1522671fd31a79c7168c':
  Add utility to determine if account can't auto-sync due to roaming
2011-11-02 19:00:58 +00:00
Mindy Pereira
af9e4ef82e am ddcb0db4: Merge "Revert "Add utility to determine if account can\'t auto-sync due to roaming"" into ics-mr1
* commit 'ddcb0db429df71356360b2224b56b01b7051c34c':
  Revert "Add utility to determine if account can't auto-sync due to roaming"
2011-11-02 17:50:05 +00:00
Marc Blank
6638627595 am 483f4927: Merge "Add utility to determine if account can\'t auto-sync due to roaming" into ics-mr1
* commit '483f49274e0aed3d4158ac6c2ba9fd693acb2809':
  Add utility to determine if account can't auto-sync due to roaming
2011-11-02 17:31:48 +00:00
Marc Blank
dea198bb04 Add utility to determine if account can't auto-sync due to roaming
* We need to call this out to the user (a surprised user is an
  unhappy user)
* Required for fix to bug referenced below

Bug: 5533550
Change-Id: I64a870a703de7e02ce882aefc3636a1668021eb8
2011-11-02 08:59:36 -07:00
Mindy Pereira
ea4adf0c6b Revert "Add utility to determine if account can't auto-sync due to roaming"
This reverts commit 95abeed64a
2011-11-01 17:17:06 -07:00
Marc Blank
95abeed64a Add utility to determine if account can't auto-sync due to roaming
* We need to call this out to the user (a surprised user is an
  unhappy user)
* Required for fix to bug referenced below

Bug: 5533550
Change-Id: I7da337057b9b28300ddd485283920e12c1ae53da
2011-11-01 14:11:43 -07:00
Marc Blank
2736c1a11c Rewrite of security policy handling and service code
* Remove PolicyService APIs policiesRequired, policiesUpdated,
  isSupported, clearUnsupportedPolicies, and isActiveAdmin
* Add PolicyService API setAccountPolicy, which is the sole
  method by which security policies are promulgated
* Add protocolPoliciesEnabled and protocolPoliciesUnsupported
  to the Policy class; these are packed, localized strings
  indicating policies that the protocol itself have enabled
  and/or cannot support (i.e. these are policies that are
  unknown to the DPM, e.g. don't load attachments)
* Differentiate in security notifications between three kinds
  of policy changes - changes that don't require user
  intervention (e.g. reducing requirements), changes that
  require user intervention (the legacy notification), and
  changes that make the account unsyncable (e.g. the server
  adding an unsupportable policy). Handle all possible policy
  changes cleanly.
* Make security notifications per account (with multiple
  accounts, notifications would get arbitrarily munged)
* Expose ALL enforced policies via the account settings
  screen in two categories: policies enforced (including
  both policies enforced by the DPM and policies enforced
  by the protocol) and policies unsupported (note that these
  can only be seen if policies are changed after an account
  is created; we do not allow the creation of an account
  when any required policies are unsupported).  Add a
  button that forces a sync attempt, for accounts that
  are locked out, but whose policies have changed on
  the server (this would otherwise require a reboot).
* Updated unit tests

Bug: 5398682
Bug: 5393724
Bug: 5379682
Change-Id: I4a3df823913a809874ed959d228177f0fc799281
2011-10-25 10:32:34 -07:00
Marc Blank
0ff0e155c5 Fix findExistingAccount to treat underscore properly
Bug: 2318959
Change-Id: Ia39ed29084dc8111c61ff552fa65519789b7c23a
2011-10-20 18:41:26 -07:00
Ben Komalo
223267f701 Merge "Fix per account starred mailboxes." 2011-10-12 19:45:12 -07:00
Ben Komalo
513486cfb5 Fix per account starred mailboxes.
We always switched to combined view when we tapped "Starred" in a
mailbox list. This was confusing since tapping to show the mailbox list
will take you to the mailbox list for the combined view, even if there's
only one account on the device! Other confusing things happened like
showing coloured account chips, even if there's only one account.

This fixes it so that we pass the account ID when building the
selection. Lots of wiring to make it happen, but very little change
overall.

Bug: 5388326
Change-Id: I1fe52f211cceca0c1b26581e200f3c7adcd0734a
2011-10-12 19:44:39 -07:00
Ben Komalo
4d3f3f3ab9 Fix hostname verifier for Exchange connections.
When the socketfactory init code was moved, I forgot to re-add in the check
to skip hostname verification. This made "Trust all SSL certificates"
checkbox useless.

Bug: 5450563
Change-Id: Ie4cba749aaf8c0fd9f9c43f09ebf354c6600d4f0
2011-10-12 13:41:59 -07:00
Marc Blank
71c9683087 Improve policy logging
Change-Id: I023b7c5302ea00ab77edd697009fb00544951a80
2011-09-30 15:00:25 -07:00
Marc Blank
b169192c8a Update account object in Policy#setAccountPolicy
* We weren't updating the account object passed in to setAccountPolicy,
  which is problematic if the object is cached and used subsequently
  in the code (it would have stale policy values)

Bug: 5245056

Change-Id: I279570dfd66c4a65d751f73e2e56578be186d339
2011-09-06 10:46:49 -07:00
Marc Blank
c28fdfeaad Throw RuntimeExceptions when PolicyService calls fail
* Rather than returning false, which can cause unexpected
  results, e.g. locking out an account until reboot
* Partial fix for the referenced bug (there might be other
  causes)

Bug: 5221119
Change-Id: I5b47093a3411deb6995624887197297323db0d2d
2011-08-29 16:18:50 -07:00
Marc Blank
185fd5b3b8 Restore return statement erroneously deleted earlier
* Screwed up in I1f6e31bfd2e7c32bdd7886e54b02fd4640a96e6f

Bug: 5205488
Bug: 5203883
Change-Id: I619135bd5dd8359b4b0573316482356a9b517865
2011-08-24 17:14:07 -07:00
Marc Blank
1aba472486 Remove unneeded logging from EmailProvider
Change-Id: I229c3044566b6067efb7a8a06c10f41dbea3ad5a
2011-08-19 16:56:29 -07:00
Marc Blank
8b755f600c Make sure reconcileAccounts in AccountService is synchronous
* This is important so that callers can know that reconciliation
  is complete.

Bug: 5189766
Change-Id: I4fbbaa6506042f975e7ad4e828fe8399c4d4a366
2011-08-19 15:27:00 -07:00
Jorge Lugo
9ca5751db0 Merge "Add conversationId field to Message" 2011-08-11 17:45:52 -07:00
Jorge Lugo
c01a783cd6 Add conversationId field to Message
So that exchange can pass along conversationId when
syncing. It's not persisted in the database.

Change-Id: I53d68b27b292b0db0fd808e0deeb28751361f1f4
2011-08-11 17:07:50 -07:00
Marc Blank
a9f1631fb8 Remove STOPSHIPs in Email/Emailcommon
Bug: 5142183
Change-Id: I1f6e31bfd2e7c32bdd7886e54b02fd4640a96e6f
2011-08-10 16:43:20 -07:00
Ben Komalo
0e6a521747 Move IntentUtils to emailcommon.
This is needed so Exchange can fire up Email activities.
No change other than the move.

Bug: 5122497
Change-Id: I6ee3f61654745fafd444314ecf75eb8ae6bbd01d
2011-08-08 14:39:19 -07:00
Ben Komalo
03cb4a2135 Merge "Hide sync options and search icon when appropriate" 2011-08-07 15:44:30 -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
994343b14b Fix SSL certificate selection for exchange.
- Since the Email and Exchange processes do not share UID, we need to
ensure the call to the KeyChain to request the certificate happens in
the Exchange process
- Misc UI fixes so it's not so ugly

Bug: 5117682
Change-Id: If80698850902e0178eb0998493b4cf4b89e2a15c
2011-08-05 11:28:52 -07:00
Marc Blank
8ba8c1648c Prevent leaking ServiceConnection when process/threads killed
Change-Id: Id5d85fbdd0d044a59cc61748432e3f714264bcd5
2011-08-03 15:40:16 -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
Marc Blank
aca9426581 Remove NotificationService; use Account columns for data storage
Bug: 5023662
Change-Id: I84df3b474dd6320327851003af985144cc16348e
2011-07-19 18:19:59 -07:00
Marc Blank
4e4aba9ebc Clean up account reconciliation
* Move AccountReconciler to the Email app (from EmailCommon)
* Ensure that Controller.deleteAccountSync() performs ALL actions
  needed to clean up after an account deletion (delete attachment
  files, reset policies, refresh the UI, etc.)
* Add reconcileAccounts() API to AccountService
* Remove accountDeleted() and restoreAccountsIfNeede() from the
  AccountService API
* Remove unused callback

Bug: 4883073
Bug: 4767084

Change-Id: I43ffaf009db1a6f306bb0f2a74fb4dd3b2c4b966
2011-07-19 10:31:33 -07:00
Ben Komalo
e71a19a523 Build default mailboxes for POP3
Bug: 4580535
Change-Id: Ic800eed387d3e9e64e95cce691d13d98b4a48045
2011-07-17 17:48:31 -07:00
Jorge Lugo
abec4e631c Merge "Prevent account flip flopping from compose" 2011-07-13 16:35:50 -07:00
Ben Komalo
4de538be2d Prevent account flip flopping from compose
There were two issues:
- the default account ID from the provider wasn't consistent: it was
using a snapshot from the cached data but that simply returns a Map, and
the values aren't guaranteed to be sorted (and indeed I saw that the
order was different on consecutive calls!)
- hitting app up from Compose always just kicked you out to the inbox
for the default account, but it probably should have used the account of
the compose screen, since it can be specified in the Intent

Bug: 5012008
Change-Id: Ic9a753b261e047790453bc1a9417bc0c6d2f87f9
2011-07-13 14:46:50 -07:00
Marc Blank
190b2fb8a1 Add support for TrafficStats; use with IMAP/POP3
* All IMAP/POP3 functionality uses TrafficStats except for
  attachment loading (subsequenc CL)

Bug: 4988322

Change-Id: I91d826e0f7151a2101b642c868ab8c37e9660332
2011-07-12 11:28:58 -07:00
Ben Komalo
f4f10a3fdf Make client certificate requests optional.
This prevents things from always failing if the server requires a client
SSL certificate.

Note that the solution used to determine if a certificate request was
made for a given request is approximate; it is timestamp based and can
theoretically give a false positive. In practice, this is very unlikely,
since another cert request had to have happened around the same time,
AND the response must be a 401/403.

Change-Id: Ieb77cf91db3bd52ba4adf1fb07357fef7e204ba5
2011-07-11 09:28:33 -07:00
Ben Komalo
025d29fd4b Fix some missed account setup flags.
There were two places where account flags were being set on setup: one
was in manual setup when the user selected the account type
(pop/imap/eas), and another was when it was automatically determined
from XML. The two paths were inconsistent and one was setting bits like
SUPPORTS_SEARCH but the other wasn't.

This fixes being able to search in IMAP

Bug: 5011932
Change-Id: I50eada7485aaef4e2a85d25fa7eb9ac7ab03093a
2011-07-10 18:26:15 -07:00