Commit Graph

120 Commits

Author SHA1 Message Date
Marc Blank 2c74ee56a4 Prevent EmailAddressAdapter from leaking cursors; load in bg
* Relates to a number of bugs related to ANR's and slow behavior
  when addressing mail
* Call changeCursor(null) on the Adapter when the activity is destroyed
* Call getCount() in the background thread to force data there rather
  than in the UI thread
* If this change is accepted, something equivalent should be
  used in the Gmail app as well
* Addresses #2180237 (P1, target Eclair_Sholes) as well as
  #2180976 and #2146926, the latter two of which were fixed
  with workarounds.

Change-Id: I7503c5fbe091dbc5e784d5a7bebeb3d60226d57d
2009-10-12 13:54:05 -07:00
Mihai Preda 1a377f096f MessageCompose: corretly set initial mSourceMessageProcessed=true for the cases where there's no source message, to avoid duplicated email addresses on orientation change.
Bug 2180955.
2009-10-12 13:39:42 +02:00
Mihai Preda 73032f4657 Email: exit AsyncTask.onPostExecute() if the result is null or isCancelled().
Bug: 2167479
2009-10-08 11:58:45 +02:00
Andrew Stadler eb7752bf69 Fix back-to-back message-id bugs
* MessageCompose now adds message-id to new messages (it was previously
    done on its behalf by MimeMessage).
* LegacyConversions.updateMessageFields() now handles missing message-id
    without error.
* Unit tests for the LegacyConversions change

These two issues were combining with a failure of comcast's SMTP server
to insert message-id headers, to prevent delivery of a message between
any two comcast accounts using this client.

Bug # http://b/issue?id=2161478
2009-10-06 14:20:09 -07:00
Mihai Preda 85d718cb07 MessageCompose: quote plain-text body if available, otherwise quote HTML body.
Bug 2082852.
2009-10-06 16:50:54 +02:00
Mihai Preda 1197ac7692 MessageCompose: allow sending email when started through external intent.
Bug: 2161199.
2009-10-02 15:53:28 +02:00
Marc Blank 2f222b4b86 Fix mail sending for new message (#2158054)
Change-Id: I18fdf62f10ca350731446728b6095dabbc049bc1
2009-09-30 17:24:47 -07:00
Marc Blank 059b3e5ed5 Make sure intro text is saved/restored properly (fix #2155286)
Change-Id: I015783972e685472ea27cbdb854511e918d8f35e
2009-09-30 08:56:32 -07:00
Mihai Preda 2ab30ce247 MessageCompose: avoid saving Draft early, before the message was loaded.
And correctly set mDraftNeedsSaving when started through external intent.

Bug: 2149148, 2152044.
2009-09-29 15:47:00 +02:00
Mihai Preda 2dd894df2f MessageCompose: fix unit tests that were broken by CL 27435.
Bug 2150598.
2009-09-29 11:19:01 +02:00
Mihai Preda 02fcd3b4e7 MessageCompose: fix loading the quoted text after a configuration change.
Bug 2136283.

Because of the mSourceMessageProcessed guard, the loading after a config change
was done exclusively by the default view hierarchy save/restore.

But this default view restore does not handle WebView content,
thus affecting the quoted text.
2009-09-28 18:07:33 +02:00
Mihai Preda 7768ce276e MessageCompose: delete the attachments that are removed in the UI.
Bug 2139949.
2009-09-28 18:04:06 +02:00
Andrew Stadler 92a1ff9b77 Per spec, allow all attachments to be added via INTENT.
* Change manifest intent-filter to */*
* Split incoming whitelist into send_ui and send_intent versions

Bugs:  2097457 (general) & 2138790 (.vcf)

Change-Id: Id4a2bb3a75808811578c643a7b841de9491efce4
2009-09-27 23:49:10 -07:00
Andrew Stadler 9d249df5b8 Add WebViewClient to specialize link-click behaviors.
* If external, set FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
* If mailto: always open the composer

Fixes bugs 1631784 and 2122326
2009-09-27 17:23:46 -07:00
Andrew Stadler b422bda4d6 Messages upsynced to "sent" should be marked as "read".
Part of cleanup of bug 2097471 but also addresses old bug 1362964.
2009-09-25 16:42:36 -07:00
Andrew Stadler c41c47fa07 Enable message upload
* Create logic to detect upsyncable messages in Sent
* Note:  Drafts is now local only for IMAP - no sync, either way
* Rewrite MessageController.processPendingAppend for Provider world
* Write provider message -> legacy message converter
* Fixed bug in IMAP APPEND (it was not picking the right UID for the
    uploaded message.)
* Better handling of server internaldate
* Add constants for new X-Android-Body-Quoted-Part header
* Add EmailContent routines to get each of the 5 parts of the body
* Remove "Load more" from unsynced message lists
* Add toString to MimeHeader for debug support

Bug # 2097471

TODO (next CL): Upload attachments records too

Change-Id: I209182f5adc6b6696919f559e3cbbdd58b3eed3a
2009-09-25 14:54:32 -07:00
Mihai Preda 1033fe606c MessageCompose: correctly handle saving Draft in relation to restarting the activity on configuration change.
Avoids saving multiple drafts when opening/closing the keyboard.
Bug 2133003.
2009-09-25 12:29:36 +02:00
Mihai Preda d66b465776 Fix loading the quoted text when editing draft.
Bug 2140036.

Only load the reply fields for an edit-draft situation.
2009-09-24 15:04:03 +02:00
Mihai Preda 0dbc15e6f1 Email: catch RuntimeException when loading message with huge body from DB.
Bug: 2133062.
2009-09-24 11:58:16 +02:00
Marc Blank 5fc57eccef Fix reply/forward for both SMTP and EAS; fixes #2138725
* Add new introText column in the Body database
* Reply/Forward put the appropriate String into this new column
* Rfc822Output uses this when required when streaming the message

Change-Id: I34602fdb3f91692c46fc8bc31ba0e6f680d445a0
2009-09-23 07:31:01 -07:00
Marc Blank a740e29357 Fix bugs related to orientation change in MessageCompose
* Save reference to LoadMessageTask and cancel it in onDestroy
* Check whether we've already processed the source message
  before calling processSourceMessage
* Fixes #2097361 (Duplicate addresses in reply/reply all)
* Fixes NPE (not in Buganizer) related to fast orientation changes
  due to duplicated background task

Change-Id: Ib8115e29c9d88db1be009df4f549f925db8a1c19
2009-09-20 13:03:44 -07:00
satok d2174733b1 Auto-sync of stale mailboxes
BUG: 2050116
- auto sync onResume
- add mNonPushMode
-- mNonPushMode is updated in SetFooterTask
2009-09-15 14:38:13 +09:00
Marc Blank f2dded3a2f Reimplement reply/forward to use mTextReply/mHtmlReply
* Move creation of final reply/forward text (i.e. new text plus
  the original) to Rfc822Output, where it belongs.
* Prepares the way for use of SmartForward/SmartReply in
  Exchange and replying w/ multipart/alternative in SMTP
* Moved test from MessageCompose to new Rfc822OutputTests, and note
  that new tests should be added (this is not a regression; there
  were never enough tests here)

Change-Id: Ibefb842f47cc9223714856d99b8d4f55b55f49e3
2009-09-13 22:28:38 -07:00
Andrew Stadler 6c21942ec4 Implement move-to-trash for IMAP and POP3.
* Define new message-loaded state "FLAG_LOADED_DELETED" (used only for
   POP3, which needs to write sentinel messages that are not displayed.)
* Also renamed the other flags to make the naming more consistent.
* Tweak MessageList query generation to inhibit display of deleted
    message sentinels, and MessagingController won't try to resync them.
* Clean up implementation of Controller.deleteMessage()
* Add support for move to trash to MessagingController.  This operates
    in three primary modes:
  * POP3 local delete (no server-side interaction)
  * POP3 server delete
  * IMAP server delete (and copy to IMAP trash mailbox)
* Add missing implementation in provider to delete all of the attachments
    for a given message
* Fix progress reporting in activities (the test for error vs. progress
    was inverted, which caused progress indicators to keep spinning
    after errors.)
* Fix broken account settings UI (POP3 delete policy was not persisting)

Addresses bug 2097409

TODO delete from trash / empty trash

Change-Id: I00188e6dc2093823106e009f35b68c760227c9e6
2009-09-10 12:44:05 -07:00
Marc Blank 6d1271aee7 Fix crash in large tests (#2108431)
Change-Id: I82a0ec81361b722bfa1cb4f197e3c999936ff192
2009-09-09 11:14:48 -07:00
Marc Blank e256983193 Add sourceKey to Body table; add flags for reply/forward in Message
* Set reply/forward flag and sourceKey as appropriate in MessageCompose
* Update provider tests accordingly

Change-Id: I7f49d80a735314a1a38f09fbf1f234257c41af8c
2009-09-08 16:42:53 -07:00
Dmitri Plotnikov a5b855898d Re-enabling email suggestions and switching to new contacts API. 2009-09-06 11:50:35 -07:00
Marc Blank b8d0c55a05 Fix reply all behavior to prevent duplicates, etc.
* Also create a bogus account if none exists to prevent setup failure
* Fixes #2087413 (Email large tests failing with Unknown URI)
* Fixes #2097361 (Duplicate email address when replying...)

Change-Id: I9ca2ac5f98db43e9009c22421c69956440356e34
2009-09-04 20:39:02 -07:00
Mihai Preda 3113ae67fd MessageCompose: Bug 2078435, Correctly set the attachement flag.
- display "saved as draft" toast for save draft.
- don't display tost for send.
- don't cancel the sender task, let it complete.
- synchronize on mDraft although not sure that it's needed.
2009-09-04 18:14:27 +02:00
Mihai Preda fa2238ca40 Email: BUG 1964940 Support multiple share from Gallery in Email 2009-09-02 15:38:48 +02:00
Mihai Preda 948e5ae63b MessageCompose: BUG 2069196, compose email from the correct account. 2009-08-28 01:29:33 +02:00
Mihai Preda ea0fea2558 MessageCompose: bug 2080075 & 2077496.
- fix bug 2080075, reply to message without text body.
- workaround bug 2077496 by temporarilly disabling the address adapter.
- unit test for MessageCompose.buildBodyText()
- use precompiled regex
2009-08-26 21:49:31 +02:00
Andrew Stadler df86adf873 Finish the code to demand-load partially loaded messages.
This happens in two primary cases:
1.  When a very large POP message was skipped during initial sync
2.  When any message was interrupted during initial sync, e.g. by
    a dropped connection.

Changes:
* Added loadMessageForView and callbacks to Controller (and touched all
    files with Controller listeners)
* Rewrote loadMessageForView in legacy MessagingController to work with
    provider.
* Update flow in MessageView to use loadMessageForView when needed.
* Restored the use of "loading.html" and "empty.html" assets (although
    I think we should replace them with simple layouts & views.)
* Some random cleanup in MessageView

Satisfies bug # 2065563
2009-08-25 10:13:35 -07:00
Andrew Stadler 4b41bae270 Enable IMAP/POP sending and EAS resend
* Finish IMAP/POP sections of Controller.sendMessage
* Rewrite MessagingController.sendPendingMessagesSynchronous
* Add deleteAllAttachmentFiles to AttachmentProvider, and unit test
* Rework sendMessage callbacks and integrate into MessageList UI
* Send pending from UI

TODO:
* Find other places from which to call deleteAllAttachmentFiles
2009-08-20 11:09:39 -07:00
Mihai Preda 44144d0301 MessageCompose: initial save attachments and load them back.
- load attachments for EditDraft.
- save attachments when save message.
- unit test for restoreAccountsWithMessageId()
2009-08-20 15:52:50 +02:00
Andrew Stadler 46d7d7f1b6 Rework service to use provider accounts and controller.
* Rewrite service logic to select and update one account at a time
* Add checkmail API to Controller, and much rework/cleanup of existing
   callback API's
* Rewrite notification posting code
* Rewire connection to MessageList to be opened by notifications, to
   cancel notifications, and to reset the "new message" count whenever
   an account is viewed.
* Boilerplate cleanup to a lot of activities because they share the
   callbacks that have had minor changes.
* Remove old push controls from Store API

In progress:
* To provide notification mechanism for EAS pushed mail
2009-08-18 00:54:34 -07:00
Mihai Preda 9627d014e1 MessageCompose: update body on save.
- plus unit tests.
- and some attachment refactoring.
- move PROJECTION_ID up to EmailContent.
- add index on messageKey to Attachments and Body tables.
- add missing Columns.ID field in EmailContent.
2009-08-17 13:43:56 +02:00
Mihai Preda a5af05f1a9 MessageCompose: load body.
- load body for edit-draft, replay, forward.
- fix debug secret code for no-keyboard devices.
- fix CR-LF BUG 1911254.
- fix menu invoke compose from folder with mailboxId < 0.
2009-08-06 11:40:42 +02:00
Mihai Preda 2917e895c7 MessageCompose:
- set displayName for composed messages (from To:)
- set FLAG_LOADED
- do the save & send in an AsyncTask
- some clean-up
2009-08-03 13:04:21 +02:00
Andrew Stadler 8f7f93a7b3 Enable account & mailbox sync for exchange
* Now attempts folder list sync for exchange
    (goto folder list and click sync)
* Folder sync never seems to call our callback - bug in EAS side?

* Now attempts mailbox sync
    (go to an EAS mailbox and click sync)

Also:
* Cleanup start/stop/error path for IMAP/POP as well
* Small bugfix in SyncManager.java (was calling wrong callback)
* No longer trying to set mailbox read/unread count in IMAP/POP
2009-07-30 18:48:12 -07:00
Andrew Stadler ea69fc40d7 Rework Controller to use new single callback from EAS.
* Use unified callback instead of per-call callbacks
* Remove per-call tag
* Rework MessageView to operate without tag
* Minor cleanups in service side
2009-07-29 18:36:01 -07:00
Mihai Preda 334903369e initial Controller.sendMessage() and invocation from MessageCompose. 2009-07-28 20:48:42 +02:00
Mihai Preda 3e79032dd1 Fix MessageCompose tests.
BUG 2017612.
2009-07-28 16:27:04 +02:00
Mihai Preda 0712ce063c Load source message in UI in MessageCompose for reply/forward/edit-draft.
Replace EmailContent.Message with Message.
Remove MessageCompose.mAccountId (mAccount is enough).
2009-07-27 21:22:37 +02:00
Mihai Preda 21ace307e0 Clean-up in MessageCompose, using EmailContent.Message.
Difficulties:
re-enable EmailHtmlUtil.resolveInlineImage() and
MessageCompose.loadAttachments() that operate on MIME parts.
2009-07-24 18:50:09 +02:00
Andrew Stadler 9e2c6bd5f2 Remove saveOrUpdate from EmailContent to prevent stale writes
* Numerous classes modified to deal with this change
  * Fixes bugs 1993292 and 1994671
  * Renamed various setter and getter methods to reflect the underlying
    field names
  * Renamed syncFrequency to syncInterval in Account and Mailbox
  * Convenience method added to AccountSettings to save only user settings
  * Calls to content.update(context, content.toContentValues()), which save
    all fields, should be double-checked for correctness, making sure that
    content has current data and will not conflict with other threads that
    might modify that data
  * Ran all unit tests to confirm proper function

NOTE:  The logic to enforce single default account no longer works,
because that logic is in Account.save() and does not run via
Account.update().  I have patched out a small section of the relevant unit
test and will file a bug to come back for this fix.
2009-07-22 15:13:30 -07:00
Andrew Stadler 54c1f2bf9a Improvements to default account handling
* Remove all references to Account.mIsDefault, which was not the right
    way to find the default account (it is lazy initialized)
* Change Account.getDefaultAccount to getDefaultAccountId, which is more
    efficient and suitable in most uses.
* Wrote unit tests for provider default account handling

This should resolve bug 1983390 as well as a few other issues with default
account management.
2009-07-21 16:44:16 -07:00
Mihai Preda c6893ddf0f First steps towards using the new EmailContent.Message in MessageCompose. 2009-07-15 13:13:45 -07:00
Andrew Stadler 72dce73390 Convert Accounts to AccountFolderList
* Move relevant sources & resources to new name
* Convert from ListView to ExpandableListView
* No children yet - selecting account simply jumps to FML (temp)
* No other change to functionality (e.g. no menu changes yet)
2009-07-09 12:33:09 -07:00
Mihai Preda ed0e683d86 Don't drop invalid addresses while editing & check that all addresses are valid before send.
BUG: 1542391
add unit tests.
2009-06-24 15:44:08 -07:00
Marc Blank a290f503f1 Refactored EmailStore, EmailContent, EmailProvider
EmailStore goes away, replaced by EmailContent
All database activity is moved to EmailProvider
2009-06-15 14:49:11 -07:00
Andrew Stadler 68a9ccfcde final cleanups to get basic message operations working properly.
* Generate compatibility UUID early enough to stick, so our localstore
db's are created correctly and not recreated over and over again.
* Compose menu items working
* Fix single-account mode (go straight to inbox)
* Lightweight Account projections where possible
* Properly show/hide default account checkbox (during new acct screens)

What works:
* All unit tests
* Editing existing accounts
* Create new accounts
* Checking account settings against server
* Mail sync using accounts
* Viewing mailboxes
* Viewing messages
* Composing messages

What breaks (in approx order of planned fixes)
* Some details of account editing
* Import of existing accounts
2009-06-09 16:13:05 -07:00
Andrew Stadler c0033f24a2 Convert remainder of app to use provider-based accounts
What works:
* Unit tests, except for com.android.email.activity.setup.*
* Editing existing accounts
* Create new accounts
* Checking account settings against server
* Mail sync using accounts
* Viewing mailboxes

What breaks (in approx order of planned fixes)
* Unit tests in com.android.email.activity.setup.*
* Viewing messages
* Composing messages
* Some details of account editing
* Import of existing accounts
2009-06-08 15:42:40 -07:00
Mihai Preda 7ac2b6e048 am a9576bda: resolved conflicts for merge of 7403a54738 to donut
Merge commit 'a9576bdad6d9711c9e790fdbad3cbb1ab5c5fb03'

* commit 'a9576bdad6d9711c9e790fdbad3cbb1ab5c5fb03':
  AI 149664: Move escapeChar from MessageView to EmailHtmlUtil.
2009-06-08 12:23:43 -07:00
Mihai Preda 7403a54738 AI 149664: Move escapeChar from MessageView to EmailHtmlUtil.
Integrate CL 148437 from DocomoEmail.
  BUG=1860250

Automated import of CL 149664
2009-06-08 11:21:18 -07:00
Mihai Preda da93b380d1 am 23a27697: Merge branch \'readonly-p4-donut\' into donut
Merge commit '23a27697963642d6450b70dd83709492c1bdde72'

* commit '23a27697963642d6450b70dd83709492c1bdde72':
  AI 149607: Add relevant title to attachment file chooser.
2009-06-05 11:41:33 -07:00
Mihai Preda a00eb291f1 AI 149607: Add relevant title to attachment file chooser.
Delete the original source message only when the message is in Drafts folder.
  If the original message is in the other folder than Drafts, it should be
  retained.
  Integrates 149194,149306,149459 from DocomoEmail.
  BUG=1860250,1887835

Automated import of CL 149607
2009-06-05 11:36:17 -07:00
Mihai Preda 372c12bfbb am a15503a4: Merge branch \'readonly-p4-donut\' into donut
Merge commit 'a15503a4a6cf46e810bde4aedc846680ed288c1c'

* commit 'a15503a4a6cf46e810bde4aedc846680ed288c1c':
  AI 149578: Fixed possible NullPointerException in MessageCompose.
2009-06-04 22:43:34 -07:00
Mihai Preda e6ec9d86e8 AI 149578: Fixed possible NullPointerException in MessageCompose.
Integrates 148996,149295 from imode email.
  BUG=1862155,1798576,1860250

Automated import of CL 149578
2009-06-04 12:48:20 -07:00
Andrew Stadler 9019315b26 Conversion to provider-based Account. What works:
* Editing existing accounts
 * Two placeholder accounts are written

What breaks (in approx order of planned fixes)
 * Some details of account editing
 * New account creation,
 * Viewing mailboxes & messages
 * Mail sync using accounts
 * Import of existing accounts
2009-06-03 16:11:36 -07:00
Mihai Preda 7436601fae AI 149523: Correctly display inline images in Reply and Forward messages.
Integrates CL 148436, 148515, 148833 from imode email.
  BUG=1814789,1860250

Automated import of CL 149523
2009-06-03 06:44:47 -07:00
Andy Stadler 7265bb729b Automated import from //branches/donutburger/...@142152,142152 2009-03-24 21:31:47 -07:00
The Android Open Source Project 3b85e2c2b5 auto import from //branches/cupcake_rel/...@138607 2009-03-13 13:04:24 -07:00
The Android Open Source Project 3debc4f25a auto import from //branches/cupcake/...@137873 2009-03-11 12:11:58 -07:00
The Android Open Source Project 96c5af40d6 auto import from //depot/cupcake/@135843 2009-03-03 19:32:22 -08:00
The Android Open Source Project 8c2158a5eb auto import from //depot/cupcake/@135843 2009-03-03 18:28:50 -08:00
The Android Open Source Project 88a1d6f92d auto import from //branches/cupcake/...@132276 2009-02-19 10:57:35 -08:00
The Android Open Source Project f7ae27b973 auto import from //branches/cupcake/...@130745 2009-02-10 15:44:04 -08:00
The Android Open Source Project 687f9962d7 Code drop from //branches/cupcake/...@124589 2008-12-17 18:05:56 -08:00
The Android Open Source Project 8978aac197 Initial Contribution 2008-10-21 07:00:00 -07:00