Commit Graph

102 Commits

Author SHA1 Message Date
Makoto Onuki fd8ee7bc50 Show confirmation dialog before discarding drafts.
1. This CL implements the most common case, which is pressing the discard
  button on MessageCompose.

2. This CL doesn't change the discard on message list, which is much trickier.
   (We need to check the message type of all messages in the selection,
   as selection can contain any number of any kind of messges in "All Starred")

Bug 3072556

Change-Id: Ib270cae726f8fd5abf7e0e7dfc34ce97019d5301
2010-11-10 14:13:05 -08:00
Makoto Onuki 0e6254223a Reverse FLAG_INCLUDE_QUOTED_TEXT
To make it compatible with old databases.

(Follow-up to Ie7bcca23)

Bug 3162967

Change-Id: Ie3bbb5089900bb9dbd0834adbdd466fa009245f9
2010-11-04 16:30:03 -07:00
Makoto Onuki bf678771b7 UI change: MassageCompose
Basic changes for the new UI.  At this point we don't know what the new phone
UI will look like, so I didn't bother trying to preserve the old behavior on
the phone UI.  The changes will affect both the phone UI and the tablet UI.

- Send, Save Draft, and Discard are now action bar commands.
- Add CC/BCC and Add Attachment are now regular buttons.
- Activity title changed to "Compose"
- Some string changes per new wireframe

Further changes (actual layout changes for the latest wireframe) should be made
only for the xlarge layout.

Change-Id: I68c9c37dfdca6736b1e35053e7f196800fcfce2e
2010-11-04 15:22:25 -07:00
Andrew Stadler c50f912676 Inhibit "send" when user is a monkey.
While monkey is active, any clicks on "send" will be mapped to "save".
Drafts will pile up, but nothing will get out.

Bug: 2799956
Change-Id: I300d50001b43c8b61062143f9a0ac914aa2deaca
2010-11-02 16:14:19 -07:00
Andrew Stadler cd09545b87 Provide runtime switch for GL acceleration
* new checkbox in debug fragment
* saved value in prefs so it's sticky
* each Activity calls a helper to enable/disable per that flag

Change-Id: I1af1ae9f401bc746cc97da00dfb0e06407b79d46
2010-11-01 16:16:27 -07:00
Makoto Onuki a76c9cdcc7 Fix reply/forward on EAS
When removing the original, need to clear FLAG_TYPE_REPLY and FLAG_TYPE_FORWARD
flags too.

Bug 3125167

Change-Id: I64be98bc10b5e1a0b9242c1c528ed96bb0a24fc1
2010-10-22 14:43:21 -07:00
Makoto Onuki 6a2265eff2 Add checkbox to include original text or not.
Added the "Include text" checkbox according to the latest mock.

Before:
- We removed original message when the user pressed X.

Now:
- We save the original message all the way till the draft is sent.
- The "Include text" check state is saved in the db.  (to Message.mFlags)

Bug 3072414

Change-Id: Ie7bcca23bb6a02d676700027b0b6cb94b6627236
2010-10-20 14:21:17 -07:00
Marc Blank 3bdba62f58 Don't duplicate attachments when saving drafts
Bug: 3070196
Change-Id: Ic9dffe57cdc81615e07b1c593fc71085e1281718
2010-10-20 13:03:33 -07:00
Dmitri Plotnikov 9d74207039 Integration with Directory API for autocomplete
The UI changes a bit - there is no separator
between the local contacts and directories.
Will bring the separator back if asked, but
most likely simply as a thick line.

Change-Id: Idfc990deff41b30d63bd8289731694e3d9a00fb6
2010-08-27 14:02:06 -07:00
Andrew Stadler 9e71be599e am 99df4d53: am b47d1a8a: am 126c9216: Block oversize attachments from being sent
Merge commit '99df4d53b620fae871fd45aaf9b8f110cb4d4288'

* commit '99df4d53b620fae871fd45aaf9b8f110cb4d4288':
  Block oversize attachments from being sent
2010-08-27 12:15:15 -07:00
Makoto Onuki 2f4e87c223 Switch to Light Holo theme, clean up menu options.
- Changed the default theme to Light.Holo
- MessageCompose now has ActionBar.
- Removed unnecessary MessageCompose menu items.

- Also removed "Add Account" menu from MessageListXL.
  (Use the + button on account settings)

- Fixed "calender response section invisible" bug.

Bug 2926517

Change-Id: Id27632ec82dad158f43b0903dbc2cb219188400d
2010-08-25 17:09:59 -07:00
Andrew Stadler 126c9216b1 Block oversize attachments from being sent
* Attachments that come in with a file:// URI do not support the complete
  set of OpenableColumns columns.  To handle this better:
  1. Obtain the openable values in two separate queries, in case one or
      the other is supported (but not both).
  2. If the size is not reported but it is a file:// URI, attempt to
     measure it directly.
  3. If the size cannot be obtained, do not upload the attachment

Bug: 2948965
Change-Id: Ic5160d39efd65eaca40ceba0dd93c3b035d2871e
2010-08-25 16:46:00 -07:00
Marc Blank 5fd986fca0 Fix problem w/ forwarding already loaded attachments
Bug: 2938562
Change-Id: I778623bf5ee56d25eab5a74d86e9f89206e7f348
2010-08-24 16:20:47 -07:00
Marc Blank c184f36c2d Revert "Convert Controller to a full service"
This reverts commit 0e6d972641.

Change-Id: I005fc34152396806468edef919a3620961ddb4fe
2010-08-24 10:27:58 -07:00
Marc Blank 0e6d972641 Convert Controller to a full service
Change-Id: I2078fd047ff46f85936c8bf798a5edd3678bb5b4
2010-08-20 13:34:09 -07:00
Marc Blank 09fd4d0a18 New asynchronous attachment loading code
* Create AttachmentDownloadService to manage all attachment downloads
  1) User requested
  2) Required for email forwarding
  3) Opportunistic downloads to enhance offline use
* New attachment related UI (pending UX approval, of course)
  1) MessageView (attachment actions, progress bar, etc.)
  2) MessageCompose (attachments for forwarded messages)
  3) Associated toasts, notifications, etc.

TODO:
* Unit tests
* Cache Management (separate CL)

Change-Id: I7864a5fb1c3f4f2be68d98341a971edc6cbacfe1
2010-08-19 14:01:08 -07:00
Makoto Onuki 21efedb67f Rework/cleanup of "refresh".
Added RefreshManager, which is responsible for getting refresh requests
from UI and keeping track of what is being refreshed.

Conceptually it's a part of Controller, but extracted for easier testing.

- Now sendPendingMessagesForAllAccounts() is owned by RefreshManager
  rather than Controller.
- Also updateMailboxRefreshTime/mailboxRequiresRefresh have been moved
  in from the Email class.
- Now MessagingException implements a method to return an error message
  for the UI.

The refresh button on 2-pane doesn't work as intended yet, because the
spec is a bit too complicated (as described in the TODO in
MessageListXLFragmentManager.onRefhres()).

This change touches many file mostly because it cleans up a lot
of code duplication.

Change-Id: I058ab745ccff10f6e574f6ec4569c84ac4a3e10e
2010-08-18 11:06:45 -07:00
Marc Blank ec29471c73 Make sure signature is added to reply/forward
* Add this to processSourceMessage in the reply/forward cases
* Add unit tests for reply and forward case

Bug: 2734321
Change-Id: I6be8383fe5f217a4bda8e669cb69f439bc8e96b6
2010-07-14 12:43:37 -07:00
Makoto Onuki 3f545a4060 Controller rework.
- Controller.Result is now a class rather than an interface,
  so subclasses don't have to implement empty methods.

- Replaced Threads with AsyncTasks, which is more light weighted
  because it uses pooled threads.

- Removed the Result argument from Controller's methods.
  These argumetns weren't used, except in serviceCheckMail.

  Regarding serviceCheckMail, the new code behave differenly from the old code.
  If there's already listeners registered when it's colled, they wouldn't get
  called in the old code, but they will in the new code.
  But I think this difference is okay because that's how it works for
  POP/IMAP accounts.

Change-Id: I37a857ce7c089c1a411cb7f1fcfcb72c9f5fd2a6
2010-06-07 16:33:44 -07:00
Makoto Onuki 4a2615e2a5 Remove Handlers from Activities.
AccountFolderList, MessageCompose and MailboxList.

Also,
- ControllerResultUiThreadWrapper now takes a Handler instead of an Activity.
  So that it can be used from a Service as well.

- ControllerResultUiThreadWrapper.getWrappee() to get the wrapped object.
  We'll eventually need this.

- I'll work on MessageList too, but the might be relatively
  large, so I'll do that in a separate CL

Change-Id: I281d88d5af1834248ec3f7463f0df3f5635149be
2010-06-02 16:47:18 -07:00
Andrew Stadler 5e354cd1db Exit most activities when accounts are deleted
This resolves cases like this:  You are in the inbox of an Exchange
account.  You click home, settings, accounts & sync, and you delete
the account.  Now re-enter the Email app.  You'll be left in a strangely
empty inbox, for an account that no longer exists.

* Set a flag any time the reconciler deletes an account
* Check that flag in onResume of any activity that depends on the account
    list and could be left in an "empty" state if account(s) are deleted.
* The Activities in which we check it are:
  * AccountFolderList
  * AccountSettings
  * MailboxList
  * MessageCompose
  * MessageList
  * MessageView
* Clear the flag any time we come in through Welcome, which will dispatch
    to other activities properly based on the number of accounts found.

Bug: 2563998
Change-Id: I00fc542581c2bed92d744a4c2e48a88f83737f11
2010-04-14 09:28:04 -07:00
Makoto Onuki 78e06eb894 Fix NPE caused by I34451000
It's unfortunate but some of the fields we cleared in I34451000 are accessed
in BG threads or after the activity is destroyed.  We could add != null checks
everywhere, but it'll be a mess.  I also think it's safer to simply remove
the "= null" lines.

On the other hand, clearing AsyncTasks are relatively safer because they are
kept only so that we can cancel them afterwards, so I kept them.  But let me
know if you want to revert the original CL.

Bug 2570603

Change-Id: I04a10dd7382bfcceb686c3e9af92f8949caf619e
2010-04-08 11:57:26 -07:00
Makoto Onuki 59cf1d05c1 Clear references to inner classes in onDestroy().
Also
- Made inner classes private if possible.
- Made some members final.

Bug 2570603

Change-Id: I34451000f2540c67e1039ea9dc4839dbec5ffab7
2010-04-07 11:54:57 -07:00
Andrew Stadler 26b4b47fb3 GAL UI cleanup work (in progress)
Provider:
  * Move UI (e.g. separator) out of provider, create it entirely in adapter
  * Remove timestamp based disambiguation (TODO throttling some other way)
  * Add cursor "extras" to report total # of results on server
UI:
  * Rewrite background-foreground threading to be more efficient and
    signal changes back to UI by calling notifyDataSetChanged())
  * Separator strings per Rich's UI (not using real strings yet)
  * Remove link back to AutoCompleteTextView

NOTE:  There's a bug in ACTV that is causing the window size not to
change properly on notifyDataSetChanged().  Framework team to investigate.

Bug: 2249514
Change-Id: I183b200dcdaa268f0612d2de6442db28e1491d40
2010-03-15 19:17:03 -07:00
Andrew Stadler e2c56fc88c GAL support
* Provides GAL autocomplete in email address fields in message composition.

General TODO list:
UI: Implement divider in adapter, not in GAL provider
UI: Use listview_separator for divider
UI: Clean up strings, move all to resources
UI: Only have one GAL lookup in flight at any time
UI: Unit tests

GAL: Use side channel for status, not a row
GAL: Shorten timeout for interactive GAL lookup
GAL: Make watchdogs work
GAL: Figure out why some calls never return (conn pool exhaustion?)
GAL: Unit tests

Bug: 2249514
Change-Id: I513e25628bc2f5ed0920e0ee509cd598b1817b3a
2010-03-15 11:12:34 -07:00
Mihai Preda c556b6bfe5 MessageCompose: when loading message, wait for save to finish.
Bug 2465675

Change-Id: I3290c676bbe63db8441a8f6d320d798abc2fcde5
2010-03-07 15:52:28 +01:00
Mihai Preda 1575e7860d MessageCompose: fix delete quoted on reply/forward for EAS.
Also fix display of quoted html text for a draft (Exchange 2007).

Bug 2363249
Bug 2444496
2010-02-17 15:28:25 +01:00
satok 2a41aa538f Add Signature to Email Composer
Bug: 1323618

- Add signature to the message
- Set selection just after the message
- Add tests for signature
2010-02-14 00:41:48 +09:00
Mihai Preda e3e65ed919 MessageCompose: properly remove quoted text from saved draft.
Bug 2363249.
2010-01-26 17:19:49 +01:00
Mihai Preda f9623b9e78 MessageCompose: show account name in title.
Bug 2338152.
2010-01-21 14:47:18 +01:00
Mihai Preda 55f5256761 MessageCompose: fix NPE cased by WebView set to null in onDestroy().
Bug 2329276.
2009-12-16 18:12:34 +01:00
Mihai Preda 3afd66cda8 MessageCompose: disable "save as draft" button logic.
Bug 2184404
Disable "save as draft" button when there are no changes to be saved.
2009-10-15 12:09:38 +02:00
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