email: deactivate sync of deleted secure accounts

There is a security hold (describe here https://android-review.googlesource.com/#/c/100460/) when a user
deactivate the email device administrator. In this case the data is deleted but the account can still
be synced.
AOSP advise was to set the hold flag over the account.

Change-Id: Ibde2e5ca13e70c527feffb906f30e61068b158be
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Revert "email: display a "load more" button"

This reverts commit eb619570517311e9e28c6be0521a21bc1aa11487.

Change-Id: Id6f8f7c15321f939533bcef33a9e624a5f9c21f3
Email: Remove "Sync mail..." option when create POP3/IMAP account

Needn't to show the "Sync mail..." option when create the POP3/IMAP account, which
match the account setting interface after create the account.

CRs-Fixed: 440989

Change-Id: I467e2807bb7ea914876fbf46027ab9d0e68211cb
Email: Fix issue "Qucik responses" in account setting UI doesn't translate

In Quick Response view, it saved the title string when the language
changed, and restored it with the saved one. That caused the language
didn't change along with the system language.

Save the resource ID of the title instead of the string.

CRs-Fixed: 425800

Change-Id: I6e32384ca6e00a8e3387b71832394cdcbec1ae90
Email: Support Email could configure the sync size function.

 - Make the user could enable the configure the sync size function to save
   the data. And the user could select the sync size for each account.
 - Add configure option in account settings interface.

Change-Id: Ic043cb67afd249263cd480a003e854ac6efe4344
Signed-off-by: scott <scott@ubuntu.com>

Conflicts:
	res/values-zh-rCN/cm_strings.xml
	res/values-zh-rHK/cm_strings.xml
Email: Let the user could add files as attachment.

 - In the general settings, the user could enable or disable the item "add
   files as attachment". After enable this item, the user could select any
   file as attachment when compose the message.

Change-Id: I2fc75f58d101b46e8e3c04d28bd02a3ab8527ea5
Signed-off-by: scott <scott@ubuntu.com>

Conflicts:
	res/values-zh-rCN/cm_strings.xml
	res/values-zh-rHK/cm_strings.xml
Email: Let the user could select recipients from Contacts.

 - In the general settings, the user could enable or disable the item
   "select recipients from Contacts". After enable this item, the user
   could select the recipients as to/cc/bcc list in the compose view.

Change-Id: I7529d8b088391daa9a0643923f67651106107478
Signed-off-by: scott <scott@ubuntu.com>

Conflicts:
	res/values-zh-rHK/cm_strings.xml
Email: Show the defined the icon on the notification.

 - Show the defined icon for the notification if the account customize it.
 - If the account didn't defined the special icon, it will show as default.

Change-Id: I6b92199d19d63c7e51548cdd2619c793e3936e30
Email: Let the user could enable "Confirm before forward" function.

 - Add one general setting item for "Confirm before forward".
 - Update the capability of the account if the account protocol is eas and
   the version is more than 12. It means the account support smart forward.

Change-Id: I4ccf7c9f985a892e322b1d8b375ab7b52b28c4d0
Signed-off-by: scott <scott@ubuntu.com>

Conflicts:
	res/values-zh-rHK/cm_strings.xml
Email: Change the smtp normal port to 25.

The smtp normal port is 25 but not 587 which is STARTTLS port.

CRs-fixed: 626567

Change-Id: I231868bf0377de8599aced279cca6d412a4182da
Email: Do not use the string res as authorities attribute.

Sometimes if use the string res as authorities attribute, the package
manager couldn't find the authorities and install the app failed.

So we set the authorities attribute directly, and set the string res
as the label.

Change-Id: I4585bbaf3a9dcedbf0895d59840bcda5232ab4d8
Email: Remove the "Message text size" setting item from general settings.

GeneralPreferences should not call PreferenceScreen.removePreference()
to disable text_zoom preference which is not its direct child.
The Email text size will be matched the System settings. So there needn't
show the setting item.

Now text_zoom preference is an unnecessary item, we will remove the
reference code and xml content for it.

CRs-Fixed: 620377

Change-Id: Idfb49f2c929a5a86458060f149eee7f2b971d158
Email: Do not delete the message from server if the user set it as "Never"

Checking the pop3 account's delete policy when delete the mail.
If the user set the delete policy as "never", then we needn't to
delete the mail from server, but only delete the mail from local.

CRs-Fixed: 625820

Change-Id: I77abd62e079e46f0a77961e7c9eab6ca94a59ec2
Email: Cache the attachment during downloading

When download an attachment, cache it into the content resolver.
So that the cached data could be reused instead of downloading
it again for everytime.

CRs-Fixed: 601682

Change-Id: Ia34bc4e69967ec78916535d270de36fe2a71f932
Email: Notify UI data changed of the unread mailbox.

Notify UI the data has been changed of the unread mailbox and UI will
update the content according to the new data.

CRs-fixed: 630974

Change-Id: I041d2638c8c4c892e6207cdac7dd89edf34d511f
Email: New a receiver to handle the checking mail action.

As the recevier need protect the checking mail action by a permission,
but the receiver also handle the secret code action which couldn't
protected by the permission. So we need move the checking mail action
to a new receiver and handle it.

Change-Id: I5e3a5f36ba2512ac8970d3f7650cee16d58d768f
Signed-off-by: scott <scott@ubuntu.com>

Conflicts:
	src/com/android/email/service/EmailServiceStub.java
Email: Display the load more view at the bottom of the mail.

 - Display the load more view at the bottom of the uncompleted mail.
 - Save the viewable parts/attachments to Attachment table. And according
   to the viewable attachments' contentId to update the message's body.
 - Notify the mail list to update if the mail's attachment flag changed.
 - Do not show the viewable attachments in the preview interface.
 - Update the sync size configuration item's layout.

CRs-fixed: 642921

Change-Id: I7d349daaf562fe65dfde9baedf69845722a24feb
Email: Do not show "Sending feedback" item if the uri is null in general settings

Caused by not set "Send feedback" invisible when feedback uri is null
in general settings.

Add the judgement to set "Send feedback" invisible when feedback uri is null.

CRs-Fixed: 620380

Change-Id: I062487bd2eb9c64d497bda42a2eaef78bb775db7
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.

CRs-fixed: 648698

Change-Id: I5c0d337323b6db28bfa51abfb732e2f8bc25735f
Email: Update sync status for mailboxs which not load from server.

For IMAP and POP3 account, there are some mailbox do not load the data
from the server. If the user try to sync them, it also need update the
sync status for these mailboxs to refresh the UI.

CRs-fixed: 652818

Change-Id: Ibcc0b4c29832120d3d9285e93adc143cfb7b1e56