Commit Graph

65 Commits

Author SHA1 Message Date
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 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 70bbe5ec3c Add columns to Attachment for UIProvider use
Change-Id: I7f85431f409dbd6a5bd6d111b18d1fc89c00b9b2
2012-03-07 13:10:23 -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 87d7a60417 Handle update of draft
Change-Id: I15c2b2b85afeff19e4ae7520c36a6119ab1e5cca
2012-02-03 09:51:07 -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
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
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 aca9426581 Remove NotificationService; use Account columns for data storage
Bug: 5023662
Change-Id: I84df3b474dd6320327851003af985144cc16348e
2011-07-19 18:19:59 -07:00
Ben Komalo 7891106a7d Write reply/forward flags on Controller.sendMessage
- also fix some mixups with the actual icon states

Bug: 4947145
Change-Id: Iec1bbfc46ac956a6bf050e4fb162b94ea3c6b316
2011-07-06 18:10:16 -04:00
Makoto Onuki 745b33b8ff Fix all NoSuchMethodErrors
Change-Id: I05adf2b99c819d6aa2d3b52c52a8c655d9307337
2011-07-01 12:44:27 -07:00
Marc Blank 9a01353f14 New search implementation for IMAP in MessagingController
* Add protocolSearchInfo column to Message table; this can be used
  to store information related to search results.  For IMAP, we
  store the serverId of the mailbox that the message lives in on
  the server
* Add upgrade code for this column
* Change MessagingController to use the proper serverId for remote
  operations, depending on whether the Message is a search result
  or not
* Fix some smaller issues with earlier code

Change-Id: I0c7f1d89a4659b95701d02646c0e8426680e2f6a
2011-06-23 22:02:00 -07:00
Jorge Lugo 5a3888f35b Added quick responses.
Added "Insert quick response" button to MessageCompose's action bar. Clicking
it opens dialog with available quick responses. Selecting one of the responses
will insert it into message body at the current cursor location. Also added
menu in account preferences to create, edit, and delete quick responses.

Change-Id: I85f3f6b36801cf112ec9d7c31135a917456173d7
2011-06-20 13:31:50 -07:00
Marc Blank f5418f1f93 Move Account into its own top-level class
Change-Id: Ide7c991b7d4d418dbe17164421425bf898ba64ee
2011-06-13 15:37:22 -07:00
Marc Blank 85e4c101b0 Remove storeUri's except during auto-setup
* Remove per-store limitations
* Use constants for VISIBLE_WINDOW, rather than having the
  potential for differences between Stores

Change-Id: Idd5e0874bba6e3390e4f093bcb03f4b1bb399c11
2011-06-09 13:34:43 -07:00
Ben Komalo 313586c8eb Introduce client cert alias for HostAuth.
Some email servers require client certificates to be presented to
establish an SSL connection. While this certificate will be maintained
by the system key store, we need to store the "alias" of the certificate
stored in that system store.

Wiring up to use the actual alias will be done in future CL's. It is
currently unused.

Change-Id: I8d1290151342daea9ceb0df8a4088405b44faa81
2011-06-07 18:48:23 -07:00
Todd Kennedy 9dcb72e1ec Add "lastTouchedTime" column to the mailbox table
The last touched time will track the last time a message within that mailbox
was read. This will be used for the recent list.

Change-Id: I97a5fda52fd09b416fc3278a11a87b807da05c9c
2011-06-03 08:51:25 -07:00
Marc Blank a613aa18f5 Merge "Add transient to Account (for holding AccountManager account)" 2011-06-02 09:41:28 -07:00
Marc Blank dcac884697 Add transient to Account (for holding AccountManager account)
Change-Id: I2eba00b4e2f4fe0dfdc71547bfac9159728ea0e9
2011-06-02 09:41:07 -07:00
Todd Kennedy fa1b3a8f37 Save widget config to shared preferences
The way the config activity communicates with the widget will be through
shared preferences. We now read / write shared preferences for widget
configuration. One step closer to the configuration activity...

Change-Id: I7c54259d84ad8d304a61652af5b3edff4c7d67db
2011-06-01 15:14:55 -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
Marc Blank fae5ebbfd2 Cleanup code in Policy
* Use a single method for setting/clearing an account's policy

Change-Id: I90fd97d4a5ba452d4656bbabd06a40797c82e10c
2011-05-25 17:38:12 -07:00
Ben Komalo 12b82d9374 Move HostAuth to top level class.
No other changes made.

Change-Id: I1c6497c98abc0f99443ea42d8aed6295b263c123
2011-05-19 15:28:48 -07:00
Makoto Onuki b36ac01792 Changes for NO_XXX
- Added Message.NO_MESSAGE
- Renamed PSEUDO_ACCOUNT_ID_NONE to NO_ACCOUNT
- Removed PARENT_KEY_NONE and use NO_MAILBOX instead
- For starters, cleaned up the UI controllers to use them.

Change-Id: I6cfd87ece2fced8e9f7c76d034c4d1dbf9e4db10
2011-05-17 14:36:00 -07:00
Makoto Onuki 4c4e4c3515 Clean up the method to build message list selection.
- Moved the method to EmailCommon.
- Use *_SELECTION for magic mailboxes
  (meaning we now use subqueries for magic mailbox selections, rather than
   building the mailbox ID list by ourselves)

Change-Id: I3ebf6af62fd912fea6faea0f75e05fc61c87af3b
2011-05-16 11:08:05 -07:00
Ben Komalo 53ea83ebf9 Move Mailbox to top level class.
No other changes made.

Change-Id: I3d8f3c521dc0d902be313b25252b4b6a4a96e7ee
2011-05-13 17:42:02 -07:00
Todd Kennedy 5701e0a555 Suspend notifications for currently shown account
We will suspend notifications whenever we display the message list for an
account (including "combined inbox").  As soon as the message list is paused,
notifications will be resumed.

Change-Id: I481a0f59ce68f89c32210d862d0267f3f334063b
2011-05-12 14:03:14 -07:00
Marc Blank ffeb7de284 Merge "Fix a race condition in which an Attachment might be wrongly deleted" 2011-05-11 18:03:26 -07:00
Marc Blank 2f6cbb021c Fix a race condition in which an Attachment might be wrongly deleted
* This is a serious bug dating back to the first Honeycomb release
* It was possible that a newly created Message could not yet be
  committed to the database when the AttachmentDownloadService
  tries to download one of that message's attachments.
* ADS, when it sees that the message (apparently) doesn't
  exist, deletes the Attachment (it appears to be orphaned)
* The effect is that the user never sees one of the attachments
  in a message.
* This bug has been reported externally
* The fix is simply to check for the message's existence before
  deciding to delete it (this check will always work properly)

Bug: 4409692

Change-Id: I106ed2fe88d2435ad7a462fced5cb307c2559fd6
2011-05-11 17:27:37 -07:00
Todd Kennedy e7fb4ac9e3 Add account observer to NotificationController
The notification controller now observes changes to the account database and
adds or removes message observers as appropriate.

Change-Id: I1670fcfd6ce744030199b86708a6ada55b239a84
2011-05-11 17:22:56 -07:00
Marc Blank 791665da67 Merge "Add plumbing for disallowing attachment download per policy" 2011-05-10 18:31:36 -07:00
Marc Blank 9d9b481a85 Add plumbing for disallowing attachment download per policy
Change-Id: I860dfb5c28933dcd4bf96c8e4bc890bff0f53c42
2011-05-10 18:26:00 -07:00
Todd Kennedy d31d64d330 Merge "Use observers to manage new message notifications" 2011-05-10 17:09:07 -07:00
Marc Blank 5d08360a9b Merge "Complete rewrite of account backup/restore code" 2011-05-10 16:23:41 -07:00
Todd Kennedy 83693a6aca Use observers to manage new message notifications
We were sort of using observers to maintain the new message notifications.
However, other parts of the code would poke into the notification controller
to set things such as a list of newly added message IDs. Now, we rely
exclusively on db observers to manage notifications.

As a side effect of this, we now set the notification text correctly to be
the most recently _added_ message. This may be different than the most recently
sent message [since there may be a non-negligable delta between when the
message was sent and when it was received].

NOTE this still suffers from an outstanding bug where we continue to get
notifications when the Eamil UX is visible. That and monitoring changes to the
account table will be addressed in future CLs.

Change-Id: I4c68273716cc685574a1ca71e5d634f53fe0d882
2011-05-10 15:36:07 -07:00
Marc Blank 9279fc1b94 Add message flags for "replied to" and "forwarded"
* These will be required for EAS logo certification

Change-Id: Iaa8c970878a319fac68b3533889e6774f9cd54f9
2011-05-09 11:22:32 -07:00
Marc Blank 0993190caf Complete rewrite of account backup/restore code
* Use EmailProvider to backup/restore into a backup database
* Remove all of the old AccountBackupRestore code
* Get rid of the legacy Account class and all of the Preferences
  crap that referenced it
* Remove corresponding tests

Change-Id: I2de75aafdacc87246174303961e58547303f641e
2011-05-09 10:39:17 -07:00
Todd Kennedy ae993bda32 Merge "Add lastSeenMessageKey column to the mailbox table" 2011-05-06 15:07:58 -07:00
Todd Kennedy a9ac20b96f Add lastSeenMessageKey column to the mailbox table
The last seen message key is the id of the last message that we've "seen" for
that mailbox

Change-Id: I197f8a191654225ada1ce553cc959db775809c88
2011-05-06 14:51:41 -07:00
Ben Komalo 8d042850fb Re-work the way MessageCompose handles attachments
Now attachments are actually stored in an explicit list, instead of
being inferred from the state of the UI. This makes it possible to
switch states and restore attachments, and test.

Change-Id: I8c5f80f17f8c9e78d880ac4a1ac6ae22c2ec0579
2011-05-06 11:53:53 -07:00
Todd Kennedy c4cdb11d24 Remove notification if messages seen off device
If we receive new messages, we may display a notification to the user. If
those same messages are read elsewhere (i.e. via a web client), we will
remove the notification.

Change-Id: Iba09afe01942e0deaac8210fd6f9b315b1c8c93f
2011-05-05 12:00:27 -07:00
Marc Blank c96cd4a848 Merge "Add new policies to Policy and associated data structures" 2011-05-05 11:49:55 -07:00
Marc Blank f91a03f520 Add new policies to Policy and associated data structures
* Update Policy unit test

Change-Id: I24a980537a73e40fca9fceb1b6ad6b2feaa9c342
2011-05-05 11:49:15 -07:00
Marc Blank 74143e89d5 Prevent NPE's in calls to database utility methods
* Before the Email/Exchange split, EmailProvider was guaranteed not to return a null
  cursor; this is no longer true
* We now throw a new RuntimeException (ProviderUnavailableException) when calling
  commonly-used utility methods (e.g. restoreXWithId) and the cursor as returned from
  EmailProvider is null (which implies that the provider isn't available).

Change-Id: I152d13bff0129c23586cd570d23c87d69cfce372
2011-05-05 08:49:34 -07:00
Marc Blank aeee10e57e Rework of security policy storage
* Replace crazy (and soon to be "full") bit fields stored in an account's
  securityFlags with a row in a newly created Policy table (thus, fully
  expandable)
* Update code from database version 17 to 18; adds Policy table, a
  policyKey row in Account, and a revised trigger that deletes Policy
  information for deleted Accounts
* Update old PolicySet unit tests to work against the new Policy class
* Add test for the conversion of securityFlags to Policy
* Tested in a variety of scenarios; appears to be functionally equivalent

Change-Id: I1505ee75230d6a0d3c2b62a46326f39c2c7f9eb5
2011-05-03 11:11:47 -07:00