Commit Graph

597 Commits

Author SHA1 Message Date
Mihai Preda
629e18ad86 Fix base64 decoder. BUG 2081740.
It was broken by CL 22378.
The bug was in the situation when "==" (two padding chars) were at
the end, the reading did not stop after the first '=',
and thus one more char of output was generated.
Add more unit-test for base64 decoding.
2009-08-27 22:24:30 +02:00
Marc Blank
f8a81b94a3 Set ContactsProvider Settings so that ungrouped Exchange contacts display by default
Change-Id: Ie7ede23efdd371816c8dc190b8269abd83c5f238
2009-08-27 11:00:59 -07:00
Android (Google) Code Review
4118beebed Merge change 22654 into eclair
* changes:
  Move some Contacts fields to new CommonDataKinds rows
2009-08-27 09:17:52 -07:00
Android (Google) Code Review
6c47a98184 Merge change 22873 into eclair
* changes:
  Clean up onCreate/onDestroy methods for SyncManager
2009-08-27 09:15:57 -07:00
Android (Google) Code Review
2ded414e99 Merge change 22840 into eclair
* changes:
  Sync "read" and "favorite" back to server.
2009-08-26 23:14:28 -07:00
Andrew Stadler
423206653f Sync "read" and "favorite" back to server.
* Add \FLAGGED support to IMAP (writeback)
* Add code in Controller to kick MessagingController
* Rewrite pending commands system to scan through provider's updated
    messages table and react
* Fix a unit test that I broke
* Cleaned out some of the old PendingCommand support

Addresses the 2nd half (upsync) of bug 1904385

TODO:
Can I add a unit test for IMAP flag writer?

Change-Id: I5a96a695d4f35fca1395506f165b86d9fb19b543
2009-08-26 23:12:02 -07:00
Marc Blank
317a92f51f Clean up onCreate/onDestroy methods for SyncManager
* Put most of onDestroy code into the run method of SyncManager's thread
* Clean up code for updating Mailboxes' SyncKey and interval
* Fixes 2080472

Change-Id: Ie16c851a686142d9fd1d810a942aa786690b1034
2009-08-26 22:09:53 -07:00
Android (Google) Code Review
6c99ea3d02 Merge change 22829 into eclair
* changes:
  Fix #2081145 (Empty subject line imitates magic eight ball)
2009-08-26 16:37:56 -07:00
Marc Blank
b01bce9b50 Fix #2081145 (Empty subject line imitates magic eight ball) 2009-08-26 16:37:05 -07:00
Android (Google) Code Review
7ac828bce8 Merge change 22823 into eclair
* changes:
  Fix bug #2080302
2009-08-26 15:50:26 -07:00
Marc Blank
1851882c8c Fix bug #2080302
* Was trying to retrieve an integer as a boolean in the ContentValues
* The actual Exception (ClassCastException) was buried by ActivityThread
2009-08-26 15:38:30 -07:00
Android (Google) Code Review
58299b0b66 Merge change 22793 into eclair
* changes:
  Handle errors in account creation by AccountManager
2009-08-26 14:31:54 -07:00
Android (Google) Code Review
eac52c9398 Merge change 22798 into eclair
* changes:
  MessageCompose: bug 2080075 &  2077496.
2009-08-26 13:57:45 -07:00
Marc Blank
a3c6c6ed29 Handle errors in account creation by AccountManager
* Don't create our EmailProvider Account until we get a confirmation from
  AccountManager that the system Account is created
* Put up an erorr dialog if AccountManager fails for some reason (this is
  what we saw in bug #2072668)
2009-08-26 13:20:23 -07: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
2ac94a9cc2 Update Star and Read/Unread from IMAP server
* Set the star and the read/unread states properly when a
    message is downloaded for the first time.
* Update them on already-downloaded messages.

This is download only - not upload
Bug 1904385

Change-Id: Id03a0957677bb39f4a57ed0542eaa8accc36ab48
2009-08-25 22:45:11 -07:00
satok
c1edb4a801 Show/Hide/Change appropriate buttons in footer of MessageList.
BUG: 1904403

* Change the text of READ/UNREAD button dynamically according to the state of selection
* Change the text of favorite button dynamically according to the state of selection
2009-08-26 08:38:06 +09:00
Marc Blank
04e3ba8ffd Move some Contacts fields to new CommonDataKinds rows 2009-08-25 15:00:15 -07:00
Andrew Stadler
98c10db510 Clean up menus in MessageList
* Final list of options while normal mailbox is shown
* New list of options while smart folder is shown
* Correct lists of context options for drafts, outbox, trash, and
    everywhere else (full list)
* Enable reply, reply all, and forward

TODO: needs a better icon for menu->folders

Resolves bug 1904421 items 4a, 4b, 5a
Resolves bug 2078092
2009-08-25 14:11:38 -07:00
satok
67be84728a Update UI of accounts folder list and smart folders
BUG: 1904417

* Changed the order of menu options
* Made context menu for smart folders
* Added context menu for Accounts
2009-08-26 03:42:49 +09:00
Mihai Preda
9b27c7fd90 MessageView: display inline images.
- also display "show pictures" the same as in donut.
- inline images don't show in attachemnts list.
2009-08-25 20:32:26 +02:00
Marc Blank
68c3c7518e Use LED for notification (same parameters as Gmail and GTalk services)
* Agreed to by Erick and Prasenjit

Change-Id: I1a0f3642c9b10f981b2feed55762407ed853763d
2009-08-25 11:06:17 -07: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
satok
60a04912e0 Change all context menus
BUG: 2051086

* Add titles to all context menus
* Fix bug that prevented display of context menus in MessageList

TODO: localize special folder names
2009-08-25 22:14:28 +09:00
satok
dadba99498 Localize special folder names
* make utility for looking up icon id for mailbox
* make utility for looking up localized name for mailbox

BUG: 2065586
2009-08-25 16:20:32 +09:00
Marc Blank
aa69a17477 Add initial support for uploading new Contacts to Exchange server
* Refactor the sync adapters to separate out parsing from commit
* Use ContactsProvider to save the SyncKey for contacts
* Fixes #2072664 and #2072456

Change-Id: I1e85c498496e83d9523489636a75f366f7fbd106
2009-08-24 18:45:14 -07:00
Marc Blank
e2e466e315 Null out reference in onDestroy method
Change-Id: Idc3b7c52ae60121756e071ed2468ee1b9496c1c1
2009-08-24 18:01:49 -07:00
Android (Google) Code Review
137be44d5c Merge change 22502 into eclair
* changes:
  Fix #2074992
2009-08-24 17:53:24 -07:00
Andrew Stadler
421a4f5595 DO NOT MERGE: Rewrite Base64InputStream from Eclair
Rewrite Base64InputStream to be much more efficient

This was broken in many, many ways but the primary offender was an
object allocation for every 4 bytes of an input stream (imagine what this
did for 900k attachment files).

The new version is completely self-contained, and is optimized for the
most common case of inner loop case of processing 4-bytes-at-a-time.
2009-08-24 16:30:44 -07:00
Dianne Hackborn
4bc4fed47b Use new service command processing to avoid leaving the service running.
The service still needs to schedule an alarm in its onStartCommand() so that
it will run in its next poll interval.

Change-Id: I66228ef573e84a5c7d33bcb07f4772626079b960
2009-08-24 16:29:02 -07:00
Marc Blank
863c6bb04f Fix #2074992
Change-Id: If60aafe60c6327ec62f2a45aae5d750da65a19a8
2009-08-24 15:57:33 -07:00
Andrew Stadler
e1f0b0a9bc MessageView: next/prev navigation.
in addition:
- fix AND-OR precedence in cursor query in MessageList.
- move special mailbox ids from MessageList to Mailbox
- move shared code from MessageList to com.android.email.Utility
- add invisible prev/next to landscape in order to avoid special-case in code
- select mailbox list using IN() instead of list of OR

Note:  Checked in by Andy to facilitate further work on MessageView.

Change-Id:	I8049be2b45fed1e4e697a0ed895492c4d0e59e0a
2009-08-24 15:00:45 -07:00
Android (Google) Code Review
dad47808e9 Merge change 22425 into eclair
* changes:
  Reenable Load More Messages for IMAP/POP
2009-08-24 10:07:07 -07:00
Andrew Stadler
77398c4289 Reenable Load More Messages for IMAP/POP
* Properly reset all mailbox limit values
* When load more messages is clicked, increment limit and resync
* Also fixed a race condition in provider

Resolves bug 2065626

Change-Id:	If50f25a5cb3b549b3acc48406c78533ad86ed4d5
2009-08-23 23:45:54 -07:00
Marc Blank
0cbdba8d62 Fix a few sync-related bugs:
* Don't leak the receiver registered by AccountManager for updates
* Only restart dead threads if they aren't logged in the syncErrorMap
  (to prevent looping behavior as seen in bug #2072456

Change-Id: Id1b4c53ef8b721bf8bfa8426627fd76831864c70
2009-08-23 10:53:53 -07:00
Marc Blank
bfe94e6eaa Fix NPE when trying to upload a Contact created on device
* Note: This functionality isn't yet implemented

Change-Id: Ie5840a6830e31acc72523b9e8d6d760bf26d523f
2009-08-23 01:24:49 -07:00
Marc Blank
5aac4a7496 Fix bug #2071895 (NPE); remove unused method. 2009-08-22 12:14:27 -07:00
Marc Blank
a27291faac Fix bug re: parsing EAS 12 flags that caused missed messages, etc.
* This is bug #2071068
2009-08-22 11:42:51 -07:00
Andrew Stadler
cab55743ac Rewrite Base64InputStream to be much more efficient
This was broken in many, many ways but the primary offender was an
object allocation for every 4 bytes of an input stream (imagine what this
did for 900k attachment files).

The new version is completely self-contained, and is optimized for the
most common case of inner loop case of processing 4-bytes-at-a-time.
2009-08-21 18:33:10 -07:00
Andrew Stadler
a9a5dd60d6 Two minor crash fixes
* Don't call deprecated presence Uri
* Don't return null from SyncManager.getAccountList()
2009-08-21 17:05:18 -07:00
satok
95993a4b84 Update Title bar to use custom titles
BUG: 2050630

* remove fat title bar
* show new titles by using custom title bar
2009-08-21 15:47:01 +09:00
Jeff Hamilton
d382107bdc Don't try to load the owner info for now, it's not available. 2009-08-20 22:51:26 -05:00
Bob Lee
ed651a645c am dbbd29c8: Updated Email to use shared trust manager instead of initializing its own copy.
Merge commit 'dbbd29c822235d0c4c2ba9bad808ff5d4b86d399' into eclair

* commit 'dbbd29c822235d0c4c2ba9bad808ff5d4b86d399':
  Updated Email to use shared trust manager instead of initializing its own copy.
2009-08-20 19:33:21 -07:00
Bob Lee
dbbd29c822 Updated Email to use shared trust manager instead of initializing its own copy. 2009-08-20 18:49:54 -07:00
Android (Google) Code Review
6fa76a70a8 Merge change 22125 into eclair
* changes:
  Integrate further with the system SyncManager/AccountManager system
2009-08-20 16:27:14 -07:00
Marc Blank
03ecce7da8 Integrate further with the system SyncManager/AccountManager system
* Look for, and act on, changes to sync settings via SyncManager/AccountManager
* Look for, and act on, deletions from within AccountManager (tested)
2009-08-20 16:17:41 -07:00
Andrew Stadler
bcff14acf2 Create setup flow for use by Accounts manager.
* Create a new entry point for the exchange setup flow and switch
    EASAuthenticatorService to call it
* Pass "eas flow mode" down through the setup screens
* Slightly modify their behavior as we go (e.g. we skip the
    (account type" screen since we know it's EAS.)
* Add a checkbox to "sync contacts from this account" and pass that
    value into ExchangeStore when we set up the account.
* Change the flow exit to pop back to the account manager instead of
    taking the user to the new inbox.

This CL satisfies cases 1 & 2 of bug # 1974752.
2009-08-20 15:51:36 -07:00
Marc Blank
a8aedb2f37 Add "contacts" option to EasAuthenticator, which determines whether Contacts should be synced
* The state of Contacts syncing can be changed from various places in the UI
* In a future CL, SyncManager will respect this setting
2009-08-20 13:39:46 -07:00
Marc Blank
41f367eddf Re-enable Contacts sync (had been turned off) 2009-08-20 13:21:48 -07:00
Android (Google) Code Review
9d174399ef Merge change 22098 into eclair
* changes:
  Fix bugs re: sending via EAS
2009-08-20 13:19:15 -07:00
Marc Blank
9178dcc9e9 Fix bugs re: sending via EAS
* Make sure each call to sendMessage returns a proper result code
* Exit outbox sync on irrecoverable errors
2009-08-20 12:05:57 -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
Marc Blank
c0c9c33322 Add URI's that atomically add a value to a particular field (Account or Mailbox)
* Message, etc. could be added, if this had a use case
* Unit test added for both Account and Mailbox cases
* Eclipse changed some parens around; it won't happen again
2009-08-20 10:27:10 -07:00
Marc Blank
d366346a64 Implement sendMessageStatus callback in EAS
* Change API for callback to include message subject (when msg is isn't valid)
* Update users of callback to add the new argument
* Use API in EasOutboxService to send status messages back to the UI

Still TODO:  Add relevant error codes for sending problems that are not related
to connection or login issues
2009-08-20 09:08:12 -07:00
Android (Google) Code Review
4399ead9f4 Merge change 22048 into eclair
* changes:
  Add checks to avoid NPE's while stopping services
2009-08-20 09:05:31 -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
Marc Blank
d696c6f2df Add checks to avoid NPE's while stopping services 2009-08-19 20:31:18 -07:00
Marc Blank
03be523b16 Don't run SyncManager unless there are EAS accounts
* Check that there is at least one EAS account before starting SyncManager thread
* Have EasAuthenticatorService ensure that SyncManager has started
2009-08-19 20:16:01 -07:00
Andrew Stadler
e346193f06 Add status item to bottom of message list.
* Add code to (optionally) add footer, update text & progress dynamically
* Add hook to dispatch various actions (refresh, load more, etc.)
* Some cleanup of the launch helpers for MessageList

TODO:
* controller handler for the "send messages" case (subsequent CL)
* controller handler for the "more messages" case (subsequent CL)
* reporting of send results etc. into the status line
2009-08-19 20:05:10 -07:00
Marc Blank
50d9356670 SyncManager now clears error state on Outbox messages before startSync 2009-08-19 16:09:35 -07:00
Marc Blank
f4d7ddb0c2 Fix message sending from EAS (the service wasn't properly set up)
* Cleanup of EasSyncService
2009-08-19 16:09:26 -07:00
Andrew Stadler
0d10783635 Finish loading large IMAP/POP messages
* Handle messages >25k
* When structure is available (e.g. IMAP) pull in the entire body
    and the list of attachments
* When structure is not available (e.g. POP) pull in a large chunk of
    the body to try and capture the message body at least.
* Implement loadAttachment for IMAP/POP to demand download large items
* Tested with IMAP & POP messages

INCOMPLETE (file bugs):
* implement logic for the old loadMessageForView calls that comes from
    MessageView (when you open a message that's partially-loaded)
* Resolve handling of mimetype when attachment info is read (currently
    we're assuming base64 in a couple of places)
* delete account => delete attachments
* delete attachment => delete file
* create account => clear existing attachments for acct id
2009-08-19 16:09:13 -07:00
Marc Blank
6b2d23ad80 Recognize EAS 12.0 attachments; fixes bug #2065022 2009-08-19 13:15:19 -07:00
Android (Google) Code Review
fc92a6c9d8 Merge change 21777 into eclair
* changes:
  Make sure Parser always reads UTF-8 strings
2009-08-19 12:02:01 -07:00
Jeff Hamilton
fb67ec958c Handle null cursors when looking up owner info. 2009-08-19 12:26:44 -05:00
Andrew Stadler
cbe513d430 Integrate EAS push notifications with the main notifications.
* Use the new account-based field for number of new messages
* Add support for async notifications in MailService
* Change EAS to call MailService to notify user
2009-08-18 19:50:18 -07:00
Marc Blank
87439307ea Make sure Parser always reads UTF-8 strings 2009-08-18 14:19:49 -07:00
Android (Google) Code Review
2cf87e6c3c Merge change 21751 into eclair
* changes:
  Make sure we log exceptions in FileLogger
2009-08-18 14:07:15 -07:00
Marc Blank
a867ebba62 Have body database attach just once, and never detach
* Much cleaner implementation
* Prevent errors when various threads collide for attach
2009-08-18 14:05:40 -07:00
Marc Blank
f2113c1dcf Make sure we log exceptions in FileLogger 2009-08-18 13:53:38 -07:00
Android (Google) Code Review
5ecdc1b635 Merge change 21756 into eclair
* changes:
  Add "num new messages" field to Account
2009-08-18 13:44:53 -07:00
Andrew Stadler
4a8c70c09b Add "num new messages" field to Account
* Reset DB version to "1"
* Added field and support code (save, restore, & parcel)
* Added forgotten mProtocolVersion to parcelable code
* Added unit test for parceling

Also, fixed race condition in SyncManager that was underlocking the
wake locks during tests.
2009-08-18 12:14:15 -07:00
Fred Quintana
4c19543c8c make syncadapter set whether the account is syncable 2009-08-18 11:06:59 -07: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
Android (Google) Code Review
d1fd72a44e Merge change 21583 into eclair
* changes:
  Add support for syncing the favorite flag to server (EAS 12.0 and up)
2009-08-17 22:50:22 -07:00
Marc Blank
cc8d74bd03 Add support for syncing the favorite flag to server (EAS 12.0 and up)
* Add test for date formatting
2009-08-17 22:48:12 -07:00
satok
f827277419 Fix to show icon trash. 2009-08-18 11:20:59 +09:00
Android (Google) Code Review
3479356779 Merge change 21597 into eclair
* changes:
  Remove tabs; fix formatting
2009-08-17 17:45:36 -07:00
Marc Blank
b486677f91 Have all mailboxes fall back reversibly on ping loop errors 2009-08-17 17:39:05 -07:00
Marc Blank
08e69d7023 Remove tabs; fix formatting
* Responding to stadler's comments for CL20566
2009-08-17 14:57:11 -07:00
Android (Google) Code Review
576fff2a45 Merge change 21528 into eclair
* changes:
  Remove unnecessary @Override from static method
2009-08-17 11:19:45 -07:00
Andrew Stadler
d8cc57c83d Remove unnecessary @Override from static method
You can't really @Override a static method, since there is no object
dispatch.  The build system allows it, but Eclipse complains.
2009-08-17 11:18:36 -07:00
Marc Blank
8d971dbc9c Remove inappropriate references to INSTANCE in SyncManager 2009-08-17 11:09:25 -07:00
Android (Google) Code Review
30c4927d27 Merge change 21505 into eclair
* changes:
  Remove unintentional catch of Exception in SyncManager
2009-08-17 09:49:11 -07:00
Marc Blank
0b89d8f5af Remove unintentional catch of Exception in SyncManager 2009-08-17 09:35:12 -07:00
Mihai Preda
a4bbb7d923 email.mail.Sender: fix order of (context, uri) arguments in reflection invocation of SmtpSender.newInstance().
Account creation was not possible because of this.
2009-08-17 15:39:55 +02: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
Android (Google) Code Review
a39992fd7d Merge change 21479 into eclair
* changes:
  Use custom icons for special mailboxes
2009-08-17 03:58:23 -07:00
satok
55c390fe93 Use custom icons for special mailboxes
BUG: 2051100

TODO: Add trash icons
2009-08-17 19:56:25 +09:00
satok
e829daa29c Set unread count of summery indox and delete unread and draft summery inboxes
Bug: 2037400
* Delete unread summery inbox
2009-08-17 19:39:25 +09:00
Android (Google) Code Review
724ec1b7da Merge change 21469 into eclair
* changes:
  do not merge: Merged CL 21093 from goog/master to goog/eclair
2009-08-16 23:10:07 -07:00
satok
73fa3562f2 do not merge: Merged CL 21093 from goog/master to goog/eclair 2009-08-17 15:08:38 +09:00
Marc Blank
c8c68fa764 Use more appropriate connectivity wait to SyncManager 2009-08-16 18:45:38 -07:00
Fred Quintana
d0254da4e0 do not merge: cherrypicked 7bb05334b3 from master branch 2009-08-16 17:15:43 -07:00
Marc Blank
6b52af214c Implement adaptive ping timeout; release wake lock waiting for connectivity
* Remove unused/duplicated classes (e.g. Base64, WbxmlSerializer, etc.)
* Code cleanup in AbstractSyncService, EasSyncService
* Remove last references to HttpURLConnection (using HttpClient now)
2009-08-16 16:40:42 -07:00
Android (Google) Code Review
b35defc76c Merge change 21216 into eclair
* changes:
  Fix EAS debug switches and clean up debug prefs code.
2009-08-13 17:47:33 -07:00
Andrew Stadler
76a211e0d9 Fix EAS debug switches and clean up debug prefs code. 2009-08-13 17:43:25 -07:00
Marc Blank
1ba0fd37a1 Cleanup; delete unused files, change log statements
* Two files were unused and therefore deleted
* userLog was changed to avoid using string concatentation until the logging
  decision is made
2009-08-13 11:30:39 -07:00
Android (Google) Code Review
b3df387094 Merge change 20621
* changes:
  Delete rows that are unused when changes are synced down
2009-08-13 09:42:27 -07:00
Andrew Stadler
c640cbbaf3 Update SMTP to send from provider messages, and attachments
* Change Sender definition (remove old Message from API) and update
    any existing calls through that API
* Rewrite SMTPSender to use provider messages
* Add attachments to RFC822Output
* Minor bugfixes in RFC822Output
* Unit tests
2009-08-13 09:31:57 -07:00
Marc Blank
b37b1b4bfe Stream rfc822 messages to a temporary file, and send using an InputStreamEntity
* Removes the need to store the entire outgoing message in memory
2009-08-12 15:35:44 -07:00
Marc Blank
8db0babf72 Separate syncInterval constants for Account and Mailbox to remove confusion 2009-08-12 09:24:12 -07:00
Android (Google) Code Review
02dd41b319 Merge change 20819
* changes:
  Use new Rfc822Output class for sending mail; fix bug in Rfc822Output
2009-08-12 09:16:45 -07:00
Android (Google) Code Review
20583edef6 Merge change 20888
* changes:
  Fixes re: CL20440, per stadler's comments
2009-08-12 09:15:52 -07:00
Mihai Preda
fb7974f5bf Fix SQL for DELETE_ORPHAN_BODIES and DELETE_BODY.
and add unit tests.
2009-08-12 12:57:09 +02:00
Android (Google) Code Review
5c3f1f8cb7 Merge change 20718
* changes:
  Renew Unread Counts and accounts on Resume See bug 2041204
2009-08-12 01:05:45 -07:00
satok
2374fcb1a0 Renew Unread Counts and accounts on Resume See bug 2041204 2009-08-12 16:06:19 +09:00
satok
5669d4542d Show the title of MessageList See bug 2029282 2009-08-12 14:55:48 +09:00
Marc Blank
33bc0bd4a5 Fixes re: CL20440, per stadler's comments 2009-08-11 20:19:28 -07:00
Marc Blank
4f195e716c Use new Rfc822Output class for sending mail; fix bug in Rfc822Output
* Change EasOutboxService to use the new Rfc822Output class for sending
* Fix small bug in Rfc822Output (was writing both in Base64 and plain text)
* Fix bug in SyncManager related to auto-starting EAS outbox
2009-08-11 20:07:42 -07:00
Marc Blank
466054d066 Minor changes to ping variables &c 2009-08-11 15:19:50 -07:00
Android (Google) Code Review
22cd410605 Merge change 20784
* changes:
  Use 5 minute ping time when connected via mobile (prevent NAT timeout)
2009-08-11 15:12:27 -07:00
Andrew Stadler
3f1ac4da94 Add code to handle IMAP/POP attachments.
IMAP messages up to about 25k will be downloaded properly.

* Move Store->Provider message rewrite code to a separate utility.
* Add code to descend a Store message and write provider attachments.
* Unit test basic IMAP attachment handler

TODO:
* handle large IMAP messages.
* unit test for POP
* unit test for large IMAP messages
2009-08-11 15:08:14 -07:00
Android (Google) Code Review
a5abab243b Merge change 20793
* changes:
  An RFC822 streamer for sending provider messages.
2009-08-11 15:05:38 -07:00
Andrew Stadler
a9a0e57436 An RFC822 streamer for sending provider messages.
* Message headers with proper encoding
* Should handle all non-US encodings properly
* Sends body text only (no HTML planned)

This is implemented but not fully tested - I'm submitting now so Marc
can evaluate & test in EAS environment.

TODO: Unit tests
TODO: Attachments
2009-08-11 14:27:36 -07:00
Marc Blank
8d8f6918c7 Use 5 minute ping time when connected via mobile (prevent NAT timeout) 2009-08-11 13:44:35 -07:00
Marc Blank
84cb2bcd59 Change PIM fallback sync to 30 mins; try ping again if changes are found 2009-08-11 09:52:27 -07:00
Marc Blank
72c62e4d33 Make verbose logging less verbose; add exception message to logging 2009-08-11 09:15:12 -07:00
Marc Blank
bd4d30f522 Push fallback per mailbox, rather than for entire account
* Also cleanup code, add comments, remove unused methods
2009-08-10 17:05:31 -07:00
Marc Blank
9d3f4abd97 Delete rows that are unused when changes are synced down 2009-08-10 11:11:21 -07:00
Marc Blank
cc402e42ab Clear error states on network reconnect; add temporary notifications; see details
* When we get a network connect broadcast, clear error states so sync can
  restart for any boxes in an error state
* Add temporary notification code for the testers
* Add file-based debug logger
* Add Exchange logging to debug screen (adds additional exchange debugging)
* Add Exchange sd card logging to debug screen (logs to sd card)
* Change setLogging service API to send an int rather than a boolean
* Make sure push mailboxes are set up again when account changes to push
* Make sure push mailboxes are set up again when account mailbox starts
* (Fixed contacts sync bug found during debugging these changes)
2009-08-09 21:20:47 -07:00
Marc Blank
71132ff6b7 Make small changes as recommended by stadler (for CL9459) 2009-08-08 21:23:28 -07:00
Marc Blank
1795efacc5 Use wake locks in running syncs; clean up associated code 2009-08-08 18:59:33 -07:00
Marc Blank
1e7829fb65 Switch from HttpURLConnection to HttpClient 2009-08-08 13:33:41 -07:00
Marc Blank
fc579d4477 Refactor, cleanup, and fix sync bugs
* Found/fixed major sync bug re: first-time sync (emulator only)
* Moved deviceId code to SyncManager
* Added code to handle some edge cases related to sync errors
2009-08-07 22:29:15 -07:00
Marc Blank
b9d6ba11c7 Fix various problems related to synchronization, reload folder list, etc.
* The reloadFolderList service call mustn't reset the account mailbox if the foler
  list has never synced
* Be careful to not commit anything after a mailbox has been stopped
* Be careful to synchronize before checking the stopped state of a mailbox
2009-08-07 12:17:23 -07:00
Marc Blank
9b598924ec Try to work around the "ping loop" problem in some Exchange 2003 servers
* First try reloading the folder list; this can sometimes work
* Otherwise, change push to 5 minute sync
* Send notification if we switch to 5 minute sync so there are no surprises
* Added syncStatus column to EmailProvider (can be used for any purpose)
* Use syncStatus to keep track of sync type, result type, and change count;
  detect ping loop as consecutive ping's with no changes
* Remove InteractiveSyncService (no longer needed)
2009-08-06 20:51:54 -07:00
Android (Google) Code Review
17d86bb529 Merge change 20277
* changes:
  Initial support for Exchange account creation via AccountManager
2009-08-06 12:51:30 -07:00
Marc Blank
06275c4207 Initial support for Exchange account creation via AccountManager
* Export AccountSetupBasics so that it can be launched by AccountManager
* Update EasAuthenticatorService to return an Intent for AccountSetupBasics
* UI needs to be updated to skip account type screen, change welcome, etc.
2009-08-06 12:50:34 -07: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
Android (Google) Code Review
47f1b7a32b Merge change 20084
* changes:
  Change context menu by mailbox type See bug 1399964 for details.
2009-08-05 23:24:57 -07:00
satok
375f968aa5 Change context menu by mailbox type See bug 1399964 for details. 2009-08-06 13:52:23 +09:00
Android (Google) Code Review
6d130d6d6d Merge change 20078
* changes:
  Separate out name and address from EAS contact email fields
2009-08-05 19:57:27 -07:00
Android (Google) Code Review
d65901784a Merge change 20206
* changes:
  Fix EmailProvider so that deletions can occur during batch operations
2009-08-05 19:54:41 -07:00
Marc Blank
cba3a48f97 Fix EmailProvider so that deletions can occur during batch operations
* Fixes bug #2034170
* Attach the body database during all batch operations
* Change insert, delete, update, and query to use the main database for
  all operations during a batch operation; trying to use the body database
  while it is attached will result in a SQLiteException (database locked)
2009-08-05 19:53:20 -07:00
Android (Google) Code Review
b3ceddb1b1 Merge change 20088
* changes:
  Don't show mailboxes with flagVisible=0 See bug 1938449 for details.
2009-08-05 19:22:17 -07:00
satok
bbcb150dee Don't show mailboxes with flagVisible=0 See bug 1938449 for details. 2009-08-06 11:21:26 +09:00
Marc Blank
25c46808c6 Check existence of mWakeLock before releasing it
* Also, unregister connectivity receiver in onDestroy method
2009-08-05 13:03:06 -07:00
Marc Blank
228d422951 Separate out name and address from EAS contact email fields
* Use newly created sync adapter column for name portion
* Fix typo in note upload
2009-08-04 22:51:07 -07:00
Marc Blank
b4d87dfdd0 Add support for note and category upload for Contacts
* Also fixed a few random bugs found while debugging
2009-08-04 11:06:58 -07:00
Marc Blank
b2bd8a8095 Add support for additional EAS contact fields
* Fix a few misc. bugs found while testing
2009-08-03 17:00:05 -07:00
Marc Blank
e7e999ee95 Send OPTIONS less frequently; remove extraneous Log command 2009-08-03 10:49:10 -07: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
Marc Blank
b9f5134672 Fix inadvertent submission with debug flag set 2009-08-03 00:10:49 -07:00
Marc Blank
6696c26da3 Fix bugs related to push & reloading folder list
* Fixed bug #2026451 (updateFolderList isn't interrupting pingLoop)
* Added some logging code related to 'ping' and manual service starts
* Handle exit from stopped sync thread better
* Fixed a bug in ContactsSyncAdapter service in which a cursor didn't
  get properly closed.
2009-08-02 15:35:04 -07:00
Marc Blank
f00dccd321 Massive reworking of EAS serialization; much smaller and faster now
* Remove all use of Strings in favor of the parser's static final int's
* Strings remain in Tags for debugging output only
* Renamed lots of classes to be more consistent
* Centralized logging behavior in Eas class
* Found and fixed some bugs in the process:
  - Account deletion wasn't removing HostAuth's correctly in the trigger
  - Adding a second EAS account was trashing the first one
  - Fixed looping sync behavior caused by Exchange 2003 bug
2009-08-01 17:55:15 -07:00
Marc Blank
cc8b35e631 Temporarily force updateFolderList to send start/stop callbacks to UI
* Keep this in place until the related bug is resolved
2009-07-31 11:02:17 -07:00
Andrew Stadler
77898e14e9 Enable logging in EAS based on Email.DEBUG flag. 2009-07-30 21:47:32 -07:00
Marc Blank
59b7da4616 Fix 2026451 (folder list update callback not being made)
* Make sure updateFolderList service call stops the account mailbox sync
* Make sure SyncManager is kicked so that it will restart (and thus do
  a folder list sync)
2009-07-30 21:34:48 -07: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
Android (Google) Code Review
5dd01e89a4 Merge change 9197
* changes:
  Use providers to update the unreadCount of Mailboxes
2009-07-30 16:23:08 -07:00
Marc Blank
758a532fce Use providers to update the unreadCount of Mailboxes
* Triggers added for insert/delete/update of Message
* update of Mailbox will never set unreadCount
* Removed old test for unread counts and replaced with on
  that tests trigger operation.
* Remove Account.updateUnreadCount (deprecated)
2009-07-30 16:03:31 -07:00
Andrew Stadler
9f9aaeaa3a Updates to AccountFolderList
* Switch to custom list item view
* Make the folder button work right
* Add the "Accounts" separator
* Change top text to "Email"
2009-07-30 15:50:08 -07:00
Marc Blank
85ef72b2ce Add support for the syncMailboxStatus/syncMailboxListStatus callback
* Allows UI to show proper progress indications depending on the status
  of a particular mailbox (running, finished, or error state)
2009-07-30 14:01:09 -07:00
Andrew Stadler
90ed7a4e23 Convert AccountFolderList to flat list
TODO: convert item to custom view
TODO: click on folder icon
TODO: mailbox per-type icons (e.g. inbox, outbox)
TODO: separator between two sections
2009-07-30 10:01:01 -07:00
Marc Blank
948c36f47a Reimplement EAS contacts sync to work w/ new system facilities
* Modify to work with ContactsProvider2
* Modify to work with system AccountManager
* Modify to work with system SyncManager (for triggering user-change syncs)
* Sync server->client for adds/deletes implemented (CP2 doesn't handle delete yet)
* Sync server->client changes handled efficiently (only write changes)
* Some fields still not handled
* Rewrote most of the CPO code to handle server->client changes
* Sync client->server works for supported fields
2009-07-30 09:22:40 -07:00
Andrew Stadler
9150b3005f Convert AccountFolderList to fat title bar style.
Also sharing fat title bar layout with MailboxList now.
2009-07-29 23:18:43 -07:00
Andrew Stadler
9e5ee4589f Create MailboxList for new UI activity.
* Shows mailboxes
* Click to open mailbox (see messages)
* Basic menus
* Fat title bar (appearance)
* Fat title bar (buttons)

Temporary hack to call this from AccountFolderList (when you click the
account groups and "expand" them, you come here instead.)
2009-07-29 19:21:37 -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
satok
183e4a7a85 Localize special folder name 2009-07-30 10:08:36 +09:00
Marc Blank
c449cba510 First pass at implementing new IEmailServiceCallback.
* Add setCallback method to IEmailService interface
* Remove the callback from loadAttachment and loadMore in SyncManager and
  EmailServiceProxy
* Remove the callback from PartRequest
* Update EasSyncService to use the saved callback in SyncManager

Note: Unsure how to handle the case in which SyncManager dies, since it
will no longer have the callback available...
2009-07-29 13:36:13 -07:00
Android (Google) Code Review
eeac194150 Merge change 8810
* changes:
  initial Controller.sendMessage() and invocation from MessageCompose.
2009-07-29 00:59:33 -07:00
Android (Google) Code Review
aef3fb963b Merge change 8744
* changes:
  Show/Hide Account folders dynamically by checking number of messages
2009-07-28 16:17:17 -07:00
satok
fac5dc2d77 Show/Hide Account folders dynamically by checking number of messages 2009-07-29 05:56:23 +09: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
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
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
Marc Blank
16470fc7db Fix bugs related to EAS upsync and the cleanup afterward. 2009-07-14 17:24:16 -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
Andrew Stadler
17250429db Various EAS related changes related to accounts and services.
* Renamed ISyncManager/ISyncManagerCallback to IEmailService/IEmailServiceCallback
* Restored ExchangeTransportExample to its original state; created ExchangeStore to
  handle validation functionality instead; updated stores.xml to reflect these changes.
* Add support for AccountManager in EAS code (this is necessary for the contacts and
  calendar providers to work with syncable data); created EasAuthenticatorService to
  as our authenticator, which required adding authenticator.xml and modifying the
  manifest to register our service with AccountManager metadata
* Created EmailServiceProxy as a convenience for the UI in calling into the EAS
  service; created EmailServiceStatus class for status codes in callbacks.
2009-07-13 19:10:08 -07:00
Andrew Stadler
ded3c915d8 Add folders to AccountFolderList
* Scan folders and write into child cursors
* Clicking a folder takes you to MessageList
* Remove most links to FolderMessageList (nearly dead!)
* Repair 1-account startup behavior (takes you directly to inbox)
* Cleanup a few basic things like context menus & refresh

TODO: Magic mailbox section at the top
TODO: As always, better linkage to sync engine(s)
TODO: Menus, context menus, etc.
TODO: Proper handling of expandable list - accounts should stay open?
2009-07-10 16:46:51 -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
Andrew Stadler
b55bfc96f4 Enable multi-selection actions
* Toggle small pane with multi-select action buttons
* Implement multi-read/unread
* Implement multi-favorites (stars)
* Implement multi-delete

TODO: menu items when there are selected items
2009-07-08 16:09:45 -07:00
Mihai Preda
e8d58c01ec Implement efficient Address pack/unpack and unit-test it.
Also unit-test legacy pack/unpack.
2009-07-08 12:07:58 -07:00
Andrew Stadler
432d1ec3ed Add custom item view to MessageList
* Stores per-message metadata
* Fix a number of todo's in MessageList
* Clicking on checkbox toggles state, updates checked list
* clicking on star toggles favorite state

To do:  When one or more messages are checked, we should slide in a
panel with action buttons.
2009-07-07 13:43:24 -07:00
Andrew Stadler
a396a9bf14 Minor cleanups (layout only) 2009-07-07 11:36:04 -07:00
Android (Google) Code Review
5e444dd794 Merge change 5793
* changes:
  Major refactor and cleanup of EAS code
2009-07-07 11:17:48 -07:00
Marc Blank
b6493a07ef Major refactor and cleanup of EAS code
* Rewrote push logic to encompass multiple folders (i.e. calendar/contacts)
    * Change inbox from push frequency to ping frequency after initial sync
    * Implement upsync logic for email (i.e. sending changes to the server)
    * Did cleanup of some files (there's still some to do) re: format, style
    * Initial one-way sync of Contacts data - add and delete are implemented
    * Created adapter package for all parts of the EAS adapter
    * Created utility package for utility code that will eventually be merged
      with code in the Email application (Base64, QuotedPrintable, etc.)
    * SyncManager/AbstractSyncService can be used in the future for other
      protocols, especially IMAP push
2009-07-07 00:30:24 -07:00
Andrew Stadler
61e6ff4521 Fixed minor typo in MessageView 2009-07-06 19:02:16 -07:00
Andrew Stadler
7c3cca80a0 Reenable delete-message UI and write delete-from-provider.
* Longpress delete in MessageList
* Delete or Menu-Delete in MessageView
* Add deleteMessage() to Controller
* Unit tests for the new code in Controller
2009-07-06 13:58:30 -07:00
Andrew Stadler
45f9dd22e1 Fix bug in GroupMessagingListener and add unit tests 2009-07-02 14:29:02 -07:00
Andrew Stadler
bb0f962dbb Enable message read/unread toggling
* Automatically marked read when entering MessageView
* Marked unread via menu selected during MessageView
* Provider updated (directly - see note)
* Enable context menu in MessageList and enable "open" & toggle unread

NOTE: Does not use the correct service notifications yet;  Just updates
the providers.

NOTE: The UI for the context menu is incomplete, it says "mark as read"
but it actually toggles the state.  The true UI is to flip the text to
match the current state e.g. "mark as read" or "mark as unread".  That
will be much simpler to implement when we switch to a custom list item
view class, where we can cache the read/unread state (and other tidbits).
2009-07-01 16:04:30 -07:00
Andrew Stadler
48c8cc34b7 Add "favorite" star to MessageView
* Shown next to subject (non-final layout)
* Value taken from provider data
* Tapping star toggles state
* State writes back to provider

NOTE:  I am currently doing the provider writeback via direct provider
calls (using the synced-message URI) but not doing it with a service call,
so at this point there is no triggering of any server-side update.
However a sync engine might "discover" the change.

NOTE:  I made a global change of "mMessage" to "mOldMessage" because
there is still a lot of legacy code in MessageView and I wanted to clearly
demarcate the code that still needs to be redone.
2009-07-01 12:11:47 -07:00
Andrew Stadler
7c3de93429 Add attachments, favorites, and selections to MessageList.
* Attachment icon is displayed when message.mAttachment != 0
* Favorite icon is set/cleared from message but not clickable
* Selection icon is not clickable

Further progress requires implementing a custom child view which can
handle sub-clicks properly.
2009-07-01 10:47:23 -07:00
Andrew Stadler
4765472db8 Add MessageList activity
* Add MessageList Activity class and Manifest entry
* Add appropriate layouts, views, etc.
* Wire into FolderMessageList

Lots to do, but this gives us a useable screen.
2009-06-30 15:15:07 -07:00
Mihai Preda
b7e954bba6 Fix ConcurrentModificationException in MessagingController.
The exception was caused by removing from the HashSet (in Controller.java)
while iterating over it. The locking offered no protection in that case.

Extracted the notification of listeners (MessagingListener) in separate class
to simplify reimplementation.

Got rid of a couple of generic catch(Exception) that were hiding surprises.
2009-06-30 11:22:43 -07:00
Andrew Stadler
ddc871d9ed Fixed a few EmailProvider omissions; added tests
* EmailProvider query wasn't handling queries for deleted messages
* EmailProvider wasn't catching exceptions on some 'drop table' ops
* Added tests of synced messages (delete and update)
2009-06-29 23:08:40 -07:00
Takaoka G. Tadashi
2ed5063274 am 4f23ebd3: Fixed Pop3Store to be able to delete message in Inbox.
Merge commit '4f23ebd3dcca596533a33e6faedb446a814d32e3'

* commit '4f23ebd3dcca596533a33e6faedb446a814d32e3':
  Fixed Pop3Store to be able to delete message in Inbox.
2009-06-29 20:20:23 -07:00
Marc Blank
73018c31d6 Add new mailbox types for use by EAS 2009-06-27 17:21:44 -07:00
Marc Blank
f374304e92 Add support for sync related provider operations
There is now a deleted table as well as an updated table for Messages,
and some new URIs that are well documented in EmailProvider
2009-06-27 14:41:41 -07:00
Takaoka G. Tadashi
4f23ebd3dc Fixed Pop3Store to be able to delete message in Inbox.
When delete policy is DELETE_POLICY_ON_DELETE, PENDING_COMMAND_TRASH
will be invoked. But in POP3 account, because of 1) Inbox is
OpenMode.READ_ONLY, 2) getMessage(uid) just after open() is not work
correctly, 3) remote Inbox folder is not closed after deleting message,
PENDING_COMMAND_TRASH does not work.  And also the fat that some POP3
server use UID with '-' prevents PENDING_COMMAND_TRASH to recognize
the message is remote message.

Internal Bug: 1651709
2009-06-26 10:36:27 +09:00
Andrew Stadler
7143d969dd Add unit tests for Provider and fix bugs that were found
Uses a mock provider to avoid touching production databases.
Includes utilities for creating accounts, mailboxes, and messages.
Tests basic object creation & readback, object deletion, and some
forms of hierarchical deletion.  Has many TODO notes for additional
tests to be written.

In EmailContent, found & fixed a few fields that weren't being written to
the database properly.
2009-06-25 00:02:29 -07:00
Android (Google) Code Review
c3905eccdd Merge change 4842
* changes:
  Don't drop invalid addresses while editing & check that all addresses are valid before send.
2009-06-24 15:49:02 -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
Andrew Stadler
5f4dbd6438 Attempt to download small messages, and POP messages.
POP doesn't supply headers in the ENVELOPE phase, so we have to
explicitly ask for, download, copy, and save small message bodies.

Fix bug in EmailProvider (it was not always detaching the body db),
leaving the DB locked in some situations.

Problems outstanding:
* POP messages are committed before they have headers, which leads
to blank entries in the UI.  It might be worth tagging them and
selecting them out until they're ready to display.
* Inefficient because we're reloading the message from the provider on
each pass, instead of hanging onto it and updating it.
* Not marking "complete" yet because we aren't handling attachments
or inline images yet.  So we keep on reloadin'.
2009-06-24 12:48:57 -07:00
Marc Blank
1cdb4077d9 Only sync EAS mailboxes 2009-06-24 09:57:05 -07:00
Marc Blank
09d13e6295 Clean up Exchange code
Clean up imports to point to the com.android.exchange version of EmailContent
Clean up some line wrapping
Update EmailContent with latest version from Email project
2009-06-23 17:59:27 -07:00
Marc Blank
2c67f1f8b8 Initial submission for EAS support (email)
* There is some temporary code ensuring that SyncManager runs (this will be removed when Exchange
is entirely independent)
* The service interface (aidl) is in place for most user-facing actions (load more, start sync, etc.)
* EAS account validation is done via aidl
* Folder and message sync appear to be functional in this early submission
* Provider now does cascading deletes (Account -> HostAuth and Mailbox, Mailbox -> Message,
  Message -> Attachment and Body)
2009-06-23 13:13:42 -07:00
Andrew Stadler
553603337a Quick cleanups of FolderMessageList and MessageView
Show date/time properly
Unpack from, to, cc, bcc
2009-06-22 21:56:04 -07:00
Andrew Stadler
7b0b463477 List messages from MessagingController & Stores.
* update MessageListener callbacks and remove the callbacks that
  edit data (this comes through the provider now).
* provide simple linkage via Controller to sync a mailbox
* update FolderMessageList to trigger mailbox sync
* rewrite synchronize to push messages into provider
* small improvements to FML (sorting;  show read/unread status)
* note: trailing whitespace cleanup in some files
2009-06-22 16:13:03 -07:00
Marc Blank
33e176f491 Remove the bodyId column in the message base for consistency
Foreign keys belong in the child, not the parent, as is done with other
EmailContent classes.  Therefore, Body has a messageKey, and Message has
no bodyKey.

Updated MessageView to use the proper query for retrieving a message body.
2009-06-22 12:13:06 -07:00
Andrew Stadler
07871c4ce7 Clean up code to delete account & delete mailbox.
Delete account was already written but needed to be cleaned out (and
removed vestiges of LocalStore code as well.)

Delete mailbox required some new code in listFolders.  This happens
every time we refresh an account.
2009-06-22 11:39:40 -07:00
Mihai Preda
6c5460886f am a4926736: Review Email tests annotations (small/medium/large) and change some annotations based on time.
Merge commit 'a492673609111fe8c41ae152d62547b267346502'

* commit 'a492673609111fe8c41ae152d62547b267346502':
  Review Email tests annotations (small/medium/large) and change some annotations based on time.
2009-06-18 13:12:45 -07:00
Mihai Preda
a492673609 Review Email tests annotations (small/medium/large) and change some annotations based on time.
Fix an NPE appearing when running the test suite.

BUG: 1566281, 1910409.
2009-06-18 12:16:28 -07:00
Andrew Stadler
bcec088320 Begin implementation of new master controller
The first thing we'll implement is a function to list remote folders,
and it will call the existing MessagingController to do that for IMAP
and POP3.

Also change default folder type # order to get desired order in UI
2009-06-17 16:15:37 -07:00
Android (Google) Code Review
19fd130680 Merge change 4482
* changes:
  Add URI's for updated messages, and Provider support for them
2009-06-17 11:26:11 -07:00
Marc Blank
e34525d0f0 Add URI's for updated messages, and Provider support for them
Messages that have been updated in the database live in a different table
and therefore can't be accessed in the provider without the added support.
2009-06-17 11:20:32 -07:00
Mihai Preda
94386cce2a am aeeefedb: Thumbnail cache file should be deleted when AttachmentProvider is created.
Merge commit 'aeeefedb43c40e887850654ac88270755f5631c1'

* commit 'aeeefedb43c40e887850654ac88270755f5631c1':
  Thumbnail cache file should be deleted when AttachmentProvider is created.
2009-06-16 16:43:07 -07:00
Mihai Preda
50a24d5e95 am 075e9d51: Added recursive limit check to renderAttachments method.
Merge commit '075e9d5104c0e23a6188677f5c9e99fcbcfdbc60'

* commit '075e9d5104c0e23a6188677f5c9e99fcbcfdbc60':
  Added recursive limit check to renderAttachments method.
2009-06-16 16:42:49 -07:00