Commit Graph

89 Commits

Author SHA1 Message Date
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
Paul Westbrook 5440a40532 Prevent NPE
If two threads call EmailContent.init(), one of them may use
uninitialized EmailContent contstants

Bug: 10355491

Change-Id: Iedcad01345989df62baf755bf4d63c123e307b7c
2013-08-16 20:27:24 -07:00
Tony Mantler c6953b7755 Reimplement QuickResponse support
b/8622751

Change-Id: Id079efcf34dce15b5f5057f937582c0e198d3d50
2013-08-16 14:08:54 -07:00
Tony Mantler 6d24534804 Continue rewriting QuickResponse support
Change-Id: I95530e84d91f4becb3de5280af83ce546e1ed093
2013-08-12 11:40:16 -07: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 5ff368b845 Improve message counting, ah ah ah!
- Restore message_count in the database.
- For UI queries on outbox, trash, and drafts,
  use message count instead of total count.

Note this won't be the right thing to do when we properly
sync trash & drafts, but we'll address that when those syncs
are fixed.

Bug: 10098601
Bug: 10113686
Change-Id: I647c74396ee12ed981d89bfb654cc6d0a25cac95
2013-07-31 14:27:01 -07:00
Yu Ping Hu 0a68a255c5 Delete unused projection.
My previous CL was a lie. Turns out I don't need this at all.

Change-Id: I090efbd19f10f0fa58566acac1886b6da54d3319
2013-07-18 17:54:03 -07:00
Yu Ping Hu 966f237e77 Hijack an unused projection.
This was unused, and I want to write a query in Exchange
that wants to get a message's mailbox key, so I'm taking
this over.

Change-Id: I142394bfd30df8c88c5e1b48347a8532a4758857
2013-07-18 11:54:10 -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
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
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 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
Paul Westbrook ae171be336 Log when there are an unexpected number of attachments
Bug: 8373916
Change-Id: I89c4e754648e59855b153d31e59afe560360fd9c
2013-03-12 19:04:28 -07: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
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 be84c68beb Use correct test for updating attachment contentUri
Bug: 7146143
Change-Id: I594c1348f52b9912074f533faece4d0cbf521fbb
2012-09-13 14:07:19 -07:00
Marc Blank 6e5bccf2c9 Use correct attachment provider authority
* Make sure new code works with old Attachment rows

Bug: 7130972
Change-Id: Ia5d258930f39266517eead535a92bb4380fdb594
2012-09-09 09:32:14 -07:00
Marc Blank 5abccf7035 Fix Imap mail sending
Bug: 7100165
Change-Id: I0922311dce1d5e18c7332eb4e1edccfdb2d2069b
2012-09-03 13:22:12 -07: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 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 7d5e2a7c08 Do "same certificate" checking when using "trust certificates"
* Refactor/simplify Transport/MailTransport
* Add serverCert column to HostAuth table in EmailProvider
* During first connection to server, save the server certificate
  in the HostAuth; on subsequent connections, ensure that the
  certificate presented has the same public key as the one
  stored
* For now, we'll just fail to connect (with a CertificateException)
  if there's a mismatch

TODO: Add some UI to handle different certificates

Bug: 6888866
Change-Id: Ia79497e89eaad8d43617b50d3771121b2ed7f687
2012-08-01 09:04:44 -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 a8b683cf3f More work on Imap2
* Handle sending mail and moving to sent folder
* Implement picker for sent folder
* Upload sent items to server
* Add support for "automatic" sync window
* Move some files from Email -> emailcommon
* The added files are copied directly from Email (and can be
  removed if/when Imap2 is merged back with Email)

Change-Id: I3a6a3d224826e547748be2f1b567b6294ad5db89
2012-07-19 14:27:17 -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 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