Commit Graph

229 Commits

Author SHA1 Message Date
Marc Blank 70edcf0538 Integrate Imap2 into Email
* Also, convert imap accounts to imap2
* The original imap service remains, but is no used
* There remain some questions about how the upgrade
  should work in terms of settings

Change-Id: I0e05edad6a1553f428a2c2fa3daf1df878d4b5f7
2012-08-22 14:17:57 -07:00
Marc Blank b89744ecfb Use appropriate prefix to infer server address
Bug: 6999072
Change-Id: I71aa184b1cfa0b6926f4dae8861f071f27d3acb2
2012-08-16 14:11:11 -07:00
Marc Blank cf3b3ae987 Prevent NPE while getting service
Bug: 6989095
Change-Id: I646e393ec77a2e31c92011868f705e0936e41d88
2012-08-16 10:18:36 -07:00
Marc Blank 970fe5316b Progress updates for POP3 message downloads
* Also, handle MessagingException when doing STAT

Change-Id: I5267b64f18a84fcc97fc2d003e49d4e373ea02c5
2012-08-03 17:03:25 -07:00
Marc Blank 7f7f7e6402 Handle server deletion of local POP deletions
* Also avoid looping through zillions of messages when
  checking uid's
* Always have 25 (or whatever the visible limit) messages
  loaded

Change-Id: Ib2f02a59cc438e3fd14d7ac607fb01d9a5fa5282
2012-08-02 20:06:38 -07:00
Marc Blank f6db592c31 POP3 renovation
* Much, much faster
* Remove message length pass and lots of other useless code
* Create pseudo-attachment for long messages (click to download) that
  includes size (so user can determine whether it's worth it)
* Handle download of message via pseudo-attachment; real attachments
  are then created as necessary.

TODO: Add real UI with UX input (or modify existing to clean up the
loose ends)
TODO: Optimizations for loading the whole message
TODO: Get server delete working (isn't working currently anyway)

Change-Id: I31f3809fc5a2f9fd490d33cfed70d2930654e71d
2012-08-02 15:26:30 -07:00
Marc Blank dba0b20d95 Handle ALERT response to login command
* Allow AccountService loginFailed API to take a reason string
* Present the reason string in the dialog shown from the login
  failure notification
* Handle ALERTs in IMAP login responses (for example, some servers
  will occasionally require web login and we need to inform them,
  rather than simply saying the password is wrong)
* This fixes a longstanding bug in our Imap1 implementation

Change-Id: I8b270cd5d4746559b6c8a78bce02f0e7c525bdea
2012-07-27 13:36:41 -07:00
Marc Blank 0b5f15d61e Make sure account capabilities get set properly in UIProvider
* Change getCapabilities API to take an account, rather than
  the id of the account
* getCapabilities() can therefore execute even before Exchange
  is fully up and running

Change-Id: Id4c2a9942ea7a21e0c56401c50206b680274b43e
2012-07-25 13:25:02 -07:00
Marc Blank 54b6b8b072 Prevent CME w/ sServiceList
Bug: 6854037
Change-Id: I0b9aadfa0b347c62bf8a3b0c5ec88330871cce2d
2012-07-20 10:51:33 -07:00
Marc Blank 00287c4d8f Remove unused code; rename some constants
* Also handle large batch operations in chunks

Change-Id: Ie566cb8d8bb73e8edd663de5228e905c223f031b
2012-07-20 10:25:11 -07:00
Marc Blank c6089bc01f Initial Imap2 implementation
This CL includes the following:
* New Imap2.apk generation (not included in builds)
* "Push IMAP" option for accounts when Imap2.apk present
* Account creation/setup
* 2-way sync of messages, deletions, flag updates
* Push (messages, flags)
* Folder list hierarchy handling
* Message text (one plain or html part)
* Picker UI for trash folder (placeholder)
* Capabilities handling/UI command

Major Imap2 new features:
* Push
* Multiple folder sync
* Sync window (like EAS)

TODO:
* Picker UI for sent folder
* Upload of sent messages to server
* Search
* Multiple viewable parts
* Probably lots more, incl. unit tests

Change-Id: Ia5d74073d9c307e0bdae72a7f76b27140dde7d14
2012-07-18 11:32:26 -07:00
Marc Blank c5afb16430 Add a bunch of stuff missed earlier
Change-Id: I7f707446a963912fe5786dacb5569e68db572d1c
2012-06-28 12:16:59 -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 824f776365 Fix up load of IMAP attachments
Change-Id: I2f55fc2c3d92eff72ebfd50ff3f782928f3a85a2
2012-03-12 09:11:46 -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 ab6321e2c4 Fix SMTP sending
Bug: 6134036
Change-Id: Id48e4bd17e7493d873d888027e68c7eb86d23198
2012-03-09 10:26:33 -08:00
Marc Blank 3408ad1113 Use proper column in loadAttachmentCallback
Bug: 6138389

Change-Id: Icd9b3454670d29e1fbd1dfc309700eb1643cc9ee
2012-03-08 21:18:04 -08:00
Marc Blank 97e4651c45 Repair brain damage
Change-Id: I1f2367476f78c5cd78d8a59e099debabceb95e3a
2012-03-08 19:48:11 -08:00
Marc Blank 420e97f0f8 Support attachment commands from UIProvider
Change-Id: Ib457808bdb424275c0abe6e1d86e3b9d33406780
2012-03-07 14:57:19 -08:00
Marc Blank af8f8a48ee Reconcile accounts in deleteAccountPIMData
Change-Id: Ifd17ef76e13ddcfa07c84429dca7bf19e6cbcfab
2012-03-07 08:43:08 -08:00
Marc Blank e1a6088ee4 Don't try to refresh combined inbox
Bug: 6022440
Change-Id: I182c0da80debff5579b850c20015253864a0cf9f
2012-03-02 10:31:11 -08:00
Marc Blank c7a10613b3 Clean up updated messages in non-syncing mailboxes
* We'll just delete the updates for that mailbox

Change-Id: I6eec384334c9b1ea42ec064a49f938c772c44489
2012-02-29 16:50:14 -08:00
Marc Blank 87c84a6d96 Send sync status updates from POP3/IMAP
Change-Id: Ia1bb5d1a302d6dde8b8979e03a762d6d45ee8cd3
2012-02-22 16:27:26 -08:00
Marc Blank 9227dbbf0f Add back attachment loading callbacks for IMAP
* Remove newly unused code

Change-Id: Ifea2193deaf35734a031500c807ce9e3abd88fb1
2012-02-19 15:21:25 -08:00
Marc Blank 7ac38af790 Re-attach mailbox sync callbacks and refresh status
Change-Id: I45de04f59f83757186f30d6ff53395a639a1d740
2012-02-17 14:05:27 -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 9c440c8b80 am 17c089fb: am ecaa9774: If we\'re stopped, make sure watchdog alarm is also stopped
* commit '17c089fb7b02bbe755a47f917f92394df6cbef03':
  If we're stopped, make sure watchdog alarm is also stopped
2012-01-26 11:49:55 -08:00
Marc Blank ecaa977413 If we're stopped, make sure watchdog alarm is also stopped
Bug: 5647625
Change-Id: I33e94107f2d6e4a38a5a221df72ed83596ca7c54
2012-01-25 14:59:54 -08: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 faf9ecc992 Enforce "auto-sync app data" setting for POP3/IMAP
* We were using the deprecated ConnectivityManager for this; we should now be
  using the setting in ContentResolver
* Also, remove broadcast receiver code that is no longer relevant

Bug: 5405352
Change-Id: I985a95071aea92d235a2708925f775b817ba2328
2011-10-03 13:05:24 -07:00
Ben Komalo 002a1802ca Prevent flicker in opening Email.
Welcome had some assumptions that some things had to be done
asynchronously, such as checking inbox status.
This can now be done on the UI thread and so transition into Email can
be done immediately in onCreate, except if there's reconciliating to
be done

Bug: 4599569
Change-Id: Iaaac21e73c985c60e1b7974fb0429948b35968e4
2011-09-19 16:50:07 -07:00
Ben Komalo 32bed4bb8e Fix unit tests.
- make attachment download service injectable
- fix assertions for account manager account checks
- update message compose ID's so they're consistent on tablet/phone

Bug: 5198343
Change-Id: I9976f5b9e5590dd61fb0a62937d3f9203fefe236
2011-08-24 10:24:42 -07:00
Marc Blank a9f1631fb8 Remove STOPSHIPs in Email/Emailcommon
Bug: 5142183
Change-Id: I1f6e31bfd2e7c32bdd7886e54b02fd4640a96e6f
2011-08-10 16:43:20 -07:00
Marc Blank 433b0ed9fe More whack-a-mole in AttachmentDownloadService
Bug: 5115008
Change-Id: I6e5236e08331cfd6a9a11868d97bf5caaf68f6fe
2011-08-03 13:28:01 -07:00
Marc Blank 41c63a05eb Catch NPE in AttachmentDownloadService
%$!@#*&%

Bug: 5055519
Change-Id: Ie155c8d0f9931b51613f7d77e4545531bc148964
2011-07-27 15:53:51 -07:00
Marc Blank cb2f0a8bb9 Ignore watchdog alarms for stopped service
Bug: 5055519
Change-Id: I35352364f3f2842932ad40e47d70646bb6d42349
2011-07-26 09:59:10 -07:00
Ben Komalo 7688300055 Fix sync window settings for EAS setup on phones
- the container is the one that should be visible/gone - individual
fields should just be visible
- also do drive by javadoc fixes

Bug: 5052310
Change-Id: I45c4b6b7f94b2b62ac94eeff0ab97bf34c9e117a
2011-07-20 11:27:11 -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
Marc Blank 90a4811551 Fix NPE in onStartCommand
Bug: 5041436
Change-Id: Ib7462e5c8cb040b7526d9a655c5ab3f41cd159b8
2011-07-18 09:49:52 -07:00
Marc Blank b2a8c2ce4c Start/stop AttachmentDownloadService as needed
Bug: 5033646
Change-Id: Ic0e75b28d0d8d5665c3f3ca864a9532fee05df8c
2011-07-17 18:06:20 -07:00
Marc Blank 6fea021e3d Remove redundant and unused constants
Change-Id: Ie8658f86737880e3127a0a2c3b7f0557dde98b29
2011-06-29 14:30:46 -07:00
Marc Blank 66a47b8dac Clean up/simplify ExchangeUtils/ExchangeStore
* Rename ExchangeUtils to EmailServiceUtils
* Create calls for Exchange to use (eventually remove these)
* Get rid of lots of nonsense in ExchangeStore

Change-Id: Ic538cfe1de57eca24088ee1f590264283d12f511
2011-06-27 12:14:04 -07:00
Marc Blank 9863dac3ee Prevent NPE when creating account...
* Yet more whack-a-mole

Bug: 4544677
Change-Id: I35eb0850b3abb13ca82dc5b19bb5511d894b5722
2011-06-23 10:52:21 -07:00
Marc Blank cbc842c5c9 Fix MailService unit tests
* These broke when we split Email/Exchange
* We now use a test authenticator and a test account type, which
  is actually far cleaner than dealing with actual accounts

Change-Id: Ib7c9f884eac484c33642a8036f47466ce641c567
2011-06-21 13:03:48 -07:00
Makoto Onuki 9dad9ad973 Move restore account to EmailProvider.
In order to reduce the UI initialization code, move
let EmailProvider restore accounts when it opens the DB.

Backup can be moved too, but I just leave it as a TODO.

Change-Id: Id5c1810904db6abaecbfecbaa8d2d53834ebf07b
2011-06-20 18:19:17 -07:00
Marc Blank f5418f1f93 Move Account into its own top-level class
Change-Id: Ide7c991b7d4d418dbe17164421425bf898ba64ee
2011-06-13 15:37:22 -07:00
Todd Kennedy 44f5cd67c9 Remove widget views
The new widget UX allows for a single display mode for the widget. This can
be configured when the widget is added or at a later time during widget
re-configuration.

We don't have the configuration activity (yet). We first need to restructure
the widget to take a single account / mailbox combination. Hooking up the
configuration activity will occur in a future CL.

Change-Id: I38a5796c44938a6abd0d2bb50ac77241cc86a497
2011-06-01 10:46:32 -07:00