Commit Graph

493 Commits

Author SHA1 Message Date
Mihai Preda
3e79032dd1 Fix MessageCompose tests.
BUG 2017612.
2009-07-28 16:27:04 +02:00
Android (Google) Code Review
67143e5680 Merge change 8646
* changes:
  Remove mOldMessage from MessageView.
2009-07-28 04:52:45 -07:00
Mihai Preda
ff683a5b98 Remove mOldMessage from MessageView.
And add Address.unpackFirst() (used in MessageView) + test.
2009-07-28 13:49:40 +02:00
Android (Google) Code Review
274576bb90 Merge change 8656
* changes:
  Load source message in UI in MessageCompose for reply/forward/edit-draft.
2009-07-28 04:47:48 -07:00
Andrew Stadler
a98de7e55e Finish Attachment support for EAS accounts.
* Change service API to allow caller to supply complete target path/file
* Also allow caller to supply the final content_uri
* In MessageView, use full integration with EAS service API and
  attachments content provider to enable:
  * Save: Only works on SD card
  * View: Works w/o SD card using content provider & intents
  * Thumbnail previews
2009-07-27 19:52:21 -07:00
Andrew Stadler
3d25a519ab Convert AttachmentProvider to use new Provider db.
* Rewrite internals to use EmailProvider instead of raw db access
  * Minor changes to APIs as necessary (and scattered changes to follow)
  * Convert unit tests and check them
2009-07-27 15:52:42 -07:00
Android (Google) Code Review
63b2ad5bfb Merge change 8633
* changes:
  Fix UnsupportedOperationException in AccountSetupBasic caused by Account.update() when !isSaved().
2009-07-27 12:46:38 -07: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
180d69e085 Fix UnsupportedOperationException in AccountSetupBasic caused by Account.update() when !isSaved().
Bug 2001896.
Introduced by CL 8158.
2009-07-27 20:56:43 +02:00
Andrew Stadler
301ac18bb7 Create tests and improve docs on AttachmentProvider
No change in functionality.  Just getting a test infrastructure in place
before rewriting to use new EmailProvider.  Provides tests for:

* get type (raw & thumb)
* open file (raw)
* open file (thumb)
* query
* resolveAttachmentIdToContentUri
2009-07-27 11:20:15 -07:00
Jean-Baptiste Queru
9502c241a2 reconcile korg/master into goog/master 2009-07-26 11:43:55 -07:00
Jean-Baptiste Queru
2f666cfd79 Merge korg/donut into korg/master 2009-07-25 17:48:03 -07:00
Andrew Stadler
627d1ae1e0 Fix permissions error creating new EAS accounts
Fixes http://b/issue?id=2003545
2009-07-24 16:25:18 -07:00
Android (Google) Code Review
c7ccb68ba4 Merge change 8253
* changes:
  Modified to display unread count correctly.
2009-07-24 14:46:52 -07:00
satok
41f775bbc7 Modified to display unread count correctly. 2009-07-25 06:42:34 +09:00
Marc Blank
b8a781f220 Load EAS attachments internally with new API ; re-sync after account changes
* Fix bugs #1993689 and #1997842
* Update test for attachment name creation
2009-07-24 12:36:52 -07: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
Android (Google) Code Review
852974bc0b Merge change 8306
* changes:
  update the permissions for the AccountManagerService
2009-07-23 17:19:33 -07:00
Marc Blank
7375d950e4 Move to single EmailContent file; fix bug #1998157 2009-07-23 16:24:48 -07:00
Fred Quintana
ee37898bcb update the permissions for the AccountManagerService 2009-07-23 11:05:37 -07:00
Andrew Stadler
6ae38e4a39 Moving message operations into Controller, and load attachments.
* Moved logic into Controller:
  * toggling read/unread
  * toggling favorite status
  * some new unit tests
  * load attachment
* Completed logic for EAS to save attachments and MessageView to
  begin and complete that process.

NOTE:  Until EAS has a mode for saving the attachment locally (and I
rewrite the attachmentprovider to handle the new database) I am
implementing "view" attachment to just call "save".  This means that
attachments "viewed" will be dropped onto the SD card, instead of
cached and flushed.

TODO:  Controller is not properly working in its own thread, yet, so
we are not properly preventing ANR's yet.
2009-07-23 09:51:01 -07:00
Marc Blank
531ae9d25f Fix bug #1997284 re: single default account
* Fixed the bug and uncommented the relevant tests in ProviderTests
2009-07-22 16:35:12 -07: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
Android (Google) Code Review
986a3b5f03 Merge change 8002
* changes:
  Prevent EAS startup race condition while debugging
2009-07-21 12:13:13 -07:00
Marc Blank
eda017627e Prevent EAS startup race condition while debugging
* Make sure that mAccount and mMailbox are up-to-date at all sync starts
* Prevent duplication of mailboxes in schema, since it's always wrong
* Add a service call to enable/disable logging in EAS
2009-07-21 12:00:16 -07:00
Andrew Stadler
4e4abc645c Clean up launch-time & account setup behaviors.
* Moved welcome message into account setup basics (name/pass)
* Reworked Welcome to go to AccountSetupBasics on count=0
* In AccountFolderList, removed old welcome message code, and add
  code to launch AccountSetupBasics when last account is deleted
* Fixed shortcut picker so launcher shortcuts work again
* Reimplemented shortcut receiver (in MessageList now)
* Default EAS accounts to SSL

Addresses bug 1916583 & 1987440
2009-07-21 11:06:14 -07:00
Marc Blank
28fc7799ce Add support for the flag (favorite) property in EAS 12; cleanup
* Support flag property in Exchange 2007 (EAS 12)
* Support startSync/stopSync/reloadFolderList in EAS service
* Cleanup files a little bit
2009-07-20 17:45:43 -07:00
Marc Blank
5790d1458f Work on EmailService calls, attachment loading, etc.
* Stubbed in attachment loading in MessageView for EAS messages
* Modified MessageView.Listener to implement IEmailServiceCallback
  for testing callback functionality
* Rewrote EmailServiceProxy entirely
* Simplified loadAttachment service call
2009-07-20 13:52:27 -07:00
Marc Blank
53093871c4 Changes to EAS: attachments, HTML text, and sending mail (without atts)
* Added HTML support for Exchange 2007 and later
* Modified MessageView to show HTML parts of body (if present)
* Replace some unused convenience methods in Body to be ones that are more
  useful (i.e. retrive body for a given message id)
* Made EAS sending operational
* Updated SyncManager to recognize the creation of new messages and check
  for work to be done (i.e. starting Outbox sync)
* Modified MessageView to remove EmailContent.X references
* Also changed the pattern EmailContent.getContent(cursor, class) to the better
  new ClassName().restore(cursor)
* Add a test of the utility to determine mime type from file name (since
  EAS doesn't provide this with attachment header information)
* Fixed bug in ProviderTestUtils in which the base (EmailContent) fields weren't
  being checked for equality in the various subclass equality testers.  Fixed a
  bug in saving emails that was caught by fixing this bug.
2009-07-18 23:31:39 -07:00
Android (Google) Code Review
d10ffd33de Merge change 7780
* changes:
  resolved conflicts for Email MessagingController null check from donut to master
2009-07-17 16:51:47 -07:00
Andrew Stadler
7e91c121bb Enable listing attachments in MessageView
* Rename internal helper class from Attachment to AttachmentInfo
* After message loads, query for Attachments
* Play back cursor adding attachments
* Commented out almost everything else related to loading or opening them
2009-07-17 16:39:31 -07:00
Brett Chabot
035ce8bcd1 resolved conflicts for Email MessagingController null check from donut to master 2009-07-17 16:18:41 -07:00
Brett Chabot
8a3b8992f9 Add null check when initializing email messaging controller visible limits.
This is to fix the NPE that would often occur during test runs. I believe the
root cause is mock accounts would be created by some email unit tests that did
not have values for all fields. Before these accounts were deleted, the main
email thread would try to access them and blow up with a NPE.
2009-07-17 11:12:07 -07:00
Andrew Stadler
4119218e2f Add support for get-attachments-by-message-id
* clean up provider URI's in this area
* minor bugfix in EmailContent, and add auto-writeback of messageId into
    saved attachments
* clean up existing attachment unit tests
* add new tests
2009-07-16 16:03:40 -07:00
Android (Google) Code Review
d4c18546fb Merge change 7580
* changes:
  Eliminate Config.LOGV (deprecated, always false). Add Email.LOGD as a development log guard.
2009-07-16 14:51:12 -07:00
Mihai Preda
f33986d5cc Eliminate Config.LOGV (deprecated, always false).
Add Email.LOGD as a development log guard.
2009-07-16 14:09:15 -07:00
Android (Google) Code Review
0dba37ec51 Merge change 7552
* changes:
  Fix push bug, minor changes to logging and removal of debug code
2009-07-16 13:14:55 -07:00
Marc Blank
6a6d67edde Fix push bug, minor changes to logging and removal of debug code 2009-07-16 13:13:54 -07:00
Andrew Stadler
3c27c65426 Small cleanups to POP/IMAP sync.
* Close after sync, so next sync will open and update message count.
2009-07-16 10:19:19 -07:00
Marc Blank
976f92908d Add support for attachments in EmailProvider and (preliminary) EAS
* EmailProvider now saves Attachment records atomically with Message (and Body,
  of course) if an ArrayList is stored in mAttachments
* Update EAS code to support attachment discovery
* Update EAS code to support attachment download via service API (preliminary)
* Add test for atomic attachment save
* Add test for unique file creation (external)
2009-07-16 00:01:57 -07:00
Android (Google) Code Review
c5f783f022 Merge change 6675
* changes:
  First steps towards using the new EmailContent.Message in MessageCompose.
2009-07-15 14:13:31 -07:00
Andrew Stadler
f2fdd899ef Clean up new account creation & initial sync.
* Give MessageList the ability to do a folder scan (from server)
    in order to "find" the inbox after account creation.
* Don't show messages that haven't even been partially downloaded yet
    (reduces flicker during POP initial sync)
* Move some folder lookup code (in MessageList) out of UI thread
* Restore simple color chip code so multiple accounts look good
    in MessageList
2009-07-15 13:28:55 -07:00
Mihai Preda
c6893ddf0f First steps towards using the new EmailContent.Message in MessageCompose. 2009-07-15 13:13:45 -07:00
Android (Google) Code Review
80d59dabbb Merge change 7336
* changes:
  Fix bugs related to EAS upsync and the cleanup afterward.
2009-07-14 21:50:05 -07:00
Marc Blank
16470fc7db Fix bugs related to EAS upsync and the cleanup afterward. 2009-07-14 17:24:16 -07:00
Jean-Baptiste Queru
5ecebb93b8 Merge commit 'goog/readonly-korg-master' into merge_korg_master 2009-07-14 17:12:57 -07:00
Marc Blank
6b158f715b Handle UI delete in EAS where the message is moved to trash
* Check for the folder of updated messages, and delete those now in trash
* Created convenience method for finding a mailbox of a particular type in
  an account (helpful for finding, say, an Inbox or Trash for a given account
* Fix deleted/updated message table so that the _id column is defined to be
  unique (to prevent duplicate change records from being written)
2009-07-14 16:04:27 -07:00
Marc Blank
316bb44e1a Use MatrixCursor instead of (internal) ArrayListCursor 2009-07-14 14:49:34 -07:00
Andrew Stadler
2999db7866 Add Summary Section to AccountFolderList ("at a glance")
* Wrap group cursor in a MergeCursor to insert 1st row
* Clean up a few loose ends (e.g. no longpress on summary row)
* Implement the summaries child cursor
* Add special queries to MessageList for Inbox, Unread, Favorites

There are *a lot* of TODO's in this checkin;  I just wanted to get some
basic UI up and running so we could start to explore issues created by
the new configuration.  A lightweight sampling:
* Aggregrate filters (e.g. all inboxes) need to be handled in the
provider, instead of with the current two-query hack.
* We'll need a lot of UI cleanup, e.g. different contextual menus
* We'll need to generalize some of the code in order to more easily
support repeating the same compound queries - e.g. MessageView actually
needs the same query in order to enable the next/prev buttons.
2009-07-14 11:44:07 -07:00