* Use a content observer to detect changes in Calendars; we use this to
determine whether or not sync has been turned off. If sync is turned
off, all events will be deleted, so we need to reset the sync key
* Make sure that all code working on Contacts also now works on Calendar
(push, etc.)
* Remove some old crufty logging and out-of-date comments
* Addresses 2433061
Bug: 2433061
Change-Id: I6299168903fcce9bf820b72b5f6bb157d9169653
* Add hold flag to Account flags
* Add code to set it (when EAS reports policy failure)
* Add code to clear it when we see changes from the device admin side
* unit tests
This should be sufficient to restart sync of an account which is on hold
due to security policy requirements. Note, this is considered a "retry",
and if the account still does not meet requirements for some reason, it
is expected that EAS sync will call policiesRequired() again.
* Includes some refactoring of internal "request" code in SyncManager
* Adds Message flags to tag meeting invites and cancellations
* Adds meetingResponse method in EmailService
* Hooks into Controller and MessageView UI included
Change-Id: I4c5e10bccc4b41956b94d9dfa55925e5af030939
* Upgrade accounts table to add security column
* Read/Write new column
* Backup/Restore new column
* Unit tests for all of the above
* First cut at defining bitfields (non-binding, just putting down ideas)
Bug: 2387961
* Workaround for (HTC bug 2275383) & (Moto bug 2226582)
* Adds checkpoints for backing up and restoring accounts
* Uses legacy Account / prefs to back up accounts - this is because
some of this code will be reused for legacy account migration
* Unit tests of Account & LegacyConversions
* Unit tests of backup & restore
* Not done: testing of EAS/Account Manager interface (this will require
deeper dependency injection, to avoid the embedded calls to the Account
Manager and other system services.)
* Due to the order in which account creation occurs in the Provider
and in AccountManager, and the fact that there are data observers
on each that initiate account reconciliation, a race condition exists
that can cause either of these accounts to appear to be orphaned,
and thereby get deleted
* We add an "incomplete" flag to the Account in EmailProvider and
set/clear it during account creation. The various reconciliation
methods will ignore accounts marked as incomplete.
Bug: 2353755
Change-Id: I13fb144dd857f839eb3471b01f271f3a0d4d8159
* Addresses #2287439 incompletely
* The most likely reason for a reply/forward to get stuck in the Outbox
is that the referenced message has been deleted from the client, with
the deletion occuring BEFORE the message gets sent (currently, the two
are completely independent)
* This change causes deletes NOT to be sent to the server if the message
to be deleted is referenced by an outgoing message
Change-Id: I146f63ab345c07e684790e1d7d1fc08870468bbf
* For each attachment we add, check the DB for an existing attachment
with similar metadata (name, mime type, content id, etc.)
* Skip adding them if already held
* Unit tests
Fixes bug http://b/2084704
* Removed obsolete "delete after 7 days" option from pop-up prefs
* Mark deleted message sentinels as "read" so they don't contribute
to unread counts.
Bug # 2157487 and Bug # 2159278
Change-Id: Ic3cbc51d6f5ede2eb923e2d0e5c0dfee377764f5
* Add "Accept all certificates" modes to incoming/outgoing secure choices
* Change URI scheme slightly to make "trust" a flag, not part of the
protocol.
* Change Stores to know about new URI scheme
* Slightly rework Transport API to make "trust" an independent flag
* Adapt HostAuth to handle new Uri scheme
* Remove the old ambiguous "optional" code, which was allowing
some unsigned certificates, but was *also* allowing TLS to
optionally start (though not SSL, despite the UI strings.)
* Add a few unit tests to EmailContent
* Add logging and a bunch of comments to TrustManagerFactory, and a bit
of simple cleanup to make it more readable.
* Add missing conversion of SSLException->CertificateValidationException
in TLS so we get the correct certificate errors from TLS too.
* Re-enable TLS for mac.com accounts (which had a certificate problem)
Fixes bug http://b/2119755, http://b/1374780, and probably a raft of
earlier and/or external bugs about certificate problems.
Change-Id: Iaf99a8da3eaadaa4cdeec224737838b5d6813e55
* 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
* Add new introText column in the Body database
* Reply/Forward put the appropriate String into this new column
* Rfc822Output uses this when required when streaming the message
Change-Id: I34602fdb3f91692c46fc8bc31ba0e6f680d445a0
* Get rid of old Account.getxxxFolderName() calls.
* Clean up any call sites to them
* Properly rename the existing special folder name identifiers
* Use a hash table in MessagingController to improve identification
of special folders for IMAP accounts
* Fix a bug in Controller, which was creating new server-side folders
using localized names.
* Fix a bunch of code in Controller that was using mContext, instead of
using mProviderContext to support testability.
* Fix broken unit tests in ControllerProviderOpsTests
Fixes bug 1904373
* Check for existing accounts with matching servername + username
* Show a dialog and block account creation
* Triggers in three cases:
* After input of an auto-setup account (e.g. Gmail or AOL)
* After input of manual setup (incoming) parameters
* After changing incoming parameters of *any* existing account
* Made some notes in EmailContent regarding fields in HostAuth that we
are not actually using.
* Added HostAuth unit tests
Primarily fixes bug # 1964449
Bonus fix for bug # 1594408
Change-Id: I49310faf6654280582e0ab3d3e40f2701bfcd21d
* Define new message-loaded state "FLAG_LOADED_DELETED" (used only for
POP3, which needs to write sentinel messages that are not displayed.)
* Also renamed the other flags to make the naming more consistent.
* Tweak MessageList query generation to inhibit display of deleted
message sentinels, and MessagingController won't try to resync them.
* Clean up implementation of Controller.deleteMessage()
* Add support for move to trash to MessagingController. This operates
in three primary modes:
* POP3 local delete (no server-side interaction)
* POP3 server delete
* IMAP server delete (and copy to IMAP trash mailbox)
* Add missing implementation in provider to delete all of the attachments
for a given message
* Fix progress reporting in activities (the test for error vs. progress
was inverted, which caused progress indicators to keep spinning
after errors.)
* Fix broken account settings UI (POP3 delete policy was not persisting)
Addresses bug 2097409
TODO delete from trash / empty trash
Change-Id: I00188e6dc2093823106e009f35b68c760227c9e6
* Fixes 2048663, 2025029, and 2100131
* Add "Trust Certificates" checkbox in EAS account creation
* Use custom ClientConnectionManager for HttpClient with registry
for plain, ssl, and tssl (trusted ssl) connection
* Use a ConnectionPool for HttpClient connections
* Remove "Domain" checkbox in EAS account creation
* Remove tests related to the "Domain" field
* TODO Write a test for valid usernames (requires a bit of research)
<name>, <email address>, <domain>/<name, and <domain>\<name> are all
valid, but there might be others
Change-Id: I4a0338df5960bfd3d679a88aaf22d1c49f49992b
* Set reply/forward flag and sourceKey as appropriate in MessageCompose
* Update provider tests accordingly
Change-Id: I7f49d80a735314a1a38f09fbf1f234257c41af8c
* Add reply columns to Body
* Remove a bunch of unused columns from Message
* Update SQL tables, content read/write, etc.
* Small tweaks to app code that was not-really-using the old columns.
* Update existing unit tests for new/changed columns
* Disable TagsTests to solve a tests failure (prexisting, not caused by
this CL)
Change-Id: Ief493796dfe219669755170d76786f91570cbb9b
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
* 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
* 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
* 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.
- 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.
* 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
* 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)
* 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
* 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)
* 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.
* 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.
* 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.
* 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
* 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)
* 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)
* 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
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.