Synchronize checkDatabases.

This function can delete the database while other
threads are trying to read it, which is bad. The readers
are already synchronized methods so this should prevent
that.
Bug: 8964541

Change-Id: I49dff01fda7c8575f0ced0cac44ab2c80f81345a
Add MAIL_SERVICE_WAKEUP and MAIL_SERVICE_SEND_PENDING actions.

Include "com.android.email.intent.action.MAIL_SERVICE_WAKEUP"
and "com.android.email.intent.action.MAIL_SERVICE_SEND_PENDING"
intent filters from AndroidManifest.xml required for
BT MAP Server profile.

Change-Id: I29aa7797ce4d6743e15ec166d7bb2b17c3abe898
Remove platform_packages_apps_Email.log file

Change-Id: I7db021e524d2b2c29cfff1dee0cf19f1eb4ac440
Email: Resolve the Welcome activity got the duplicate finish request.

The Email welcome activity will get the duplicate finish request, and
the user could found before the welcome activity display, it will flash
another activity. It is caused by the UI thread run in one async task.

Move the runOnUiThread function out of the funAsyncParallel.

Change-Id: I3242e61b99d4b4676da605e89d53ff1fef1d12c7
Email: Encoded the name of the attachment files.

Caused by the file maybe not named by the English alphabet.

So accroding to RFC822, need encoded it.

Change-Id: I7b074b6084be78b188d43d1c826897ef7125b349
CRs-Fixed: 384203
Email: Restore the data of SetupData after rotate the screen.

Caused by the user rotate the screen when checking the settings,
the SetupDate will lose the data of current account.

So need restore the data with the mAccount.

Change-Id: If5eb02154347c85cd8f611514e167b7f42d85265
CRs-Fixed: 361995
Email: Resolve the behavior is not same when save the draft.

Sometimes the behavior is not same when the user try to save the draft.
For example, if there isn't any attachment in the forward draft, it can
not be saved, but if it contains the attachment, it could be save.

Change-Id: I7bdf05c55adc176f7606b9cee26ac3b0961f3daf
CRs-Fixed: 373150
Email: Resolve the draft maybe restored with the source message.

If the draft has the source message such as the forward mail, when the user
try to view or edit this draft, the content will be restored with the source
message. This is caused by it will be restored when it got the action (Such
as forward, reply, and so on.) changed event.

So need to get if it need restore the content on action changed.

Change-Id: I06174441b5ab755b5c2081b1905f4909c748af67
CRs-Fixed: 415044
Email: Resolve the count of the starred mail is not right problem.

The count of the starred mail for the special account will be display as the
count of the starred mail for all the account. It is caused by it will get
the count for the combined mailbox.

So need change to get the count for the special account.

Change-Id: I9ab5b0f83a677e7842d6134a44e2e0e2ce38df6a
CRs-Fixed: 405076
Email: Resolve the selected number may be incorrect problem.

Once the message list goes into the selected mode by selected some mails in,
the list, and then modify one of the selected item, for example, delete one
selected mail. Then back to the message list. The selected number will be not
updated, and it will be displayed as the last selected number. This is caused
by the selected set will be not updated with the new list.

So need to update the selected set according to the new list items.

Change-Id: Idf30dcbf54977ba5a54b088f5614d12b9c854028
CRs-Fixed: 424529
Email: Support Email sync size function.

- Make the user could set sync size to load mails;
- Make the user could fetch the entire mail if the mail has not been synced completely;

Change-Id: I30da05a7f4679e9fe2305340f5691be2ee037fab
Email: Support attach any file to mail as attachment.

Make the user could add any file to the mail as one attachment.

Change-Id: I26040ecbf6543fbc91401c0dda4441741542e1b1
Email: Support pick contacts as recipients.

If the user composes a mail, the user could pick the contacts as recipients.

Change-Id: I367bf3747c14b3a700b6affa744e842875da543c
Email: Prompt a dialog to alert the user if delete some mails.

If the user try to delete some mails, there will prompt a dialog to alert the user, and
need the user confirm the delete action.

Change-Id: Iedbabba9cebdfd5667d5e528ab66ada694936c74
Email: Prompt a dialog if the user forward a mail with uncompleted attachment.

When the user try to forward a mail which attachment haven't been dowloaded completely,
it will prompt a dialog to provide the user two options:
 - Forward the downloaded attachment directly;
 - Forward the mail after download the entire attachment;

Change-Id: Ia6df4b1c512c8d0f48cba2626cd93e2106825aaa
Email: The mails in Sent or Outbox will show the original mail.

If the mails in Sent or Outbox have the original mail, it will display the original mail
for the IMAP or POP3 account.

Change-Id: I82e585cc9b95e1123d25cfd311f9be5663e10665
Email: Display 189 mail icon as notify icon for 189 mail account.

When the 189 mail account receive the new mails or any other, it will display the 189 mail
icon as the notify icon instead of the default notify icon.

Change-Id: I1e21edd4d3f6e96669ef0e21a019cde664e4d016
Email: Display the sending mails progress as notification.

If it send the mails, it will notify the sending progress. For example, it will display
the progress for start, send failed and send completed info.

Change-Id: I8730cc870a6296c730afef5f729377daac71062a
Email: Enable the share function even if there isn't any account.

Make the user could select Email to share the files or something else even if there
isn't any Email account. Then it will display the add account interface. Once the
account create successfully, it will display the compose interface, and the shared
files will be added as the attachment.

Change-Id: I939e10ab4f07dcc5d9485f2786abfdafe7650819
CRs-Fixed: 496744
Email: Preload the configuration data for special spec.

Use providers_spec.xml to define the configuration data for specail email providers.
And the application will load different configuration data according to the carriers.

Change-Id: I1c46cc2287437241d0248bd6e16d41468bfef597