Don't allow duplicate messages to appear in Sent folder

b/11224731
There is a problem in ImapService.processPendingUploads().
It was trying to process updates to existing messages
as uploads. This is wrong, it means that marking a sent
messages as Read can cause it to be uploaded again,
resuling in a new message being created.

Change-Id: I502df52a7b315daeee10c1041db8f30dbfd2c04e
Don't bail out of downloading an attachment if the size is delcared as zero

b/11225306

Change-Id: If67401dd3e6b652b03fba2e71cfc82fdae80ccb2
Fix resource overlay order for AOSP Email

b/11255375

Change-Id: I2aa677024500b9944e9bce7846ba7488c28748a8
Treat updates into non-existent body rows as inserts.

Bug: 11245727
Change-Id: I648b0267e9149f3f431ce01be9789087f73edab1
Change trigger to allow duplicate messages in search folders

b/11294681
b/11325976
The problem is that when we get a message as part of a search
result, we'll end up deleting that message from the inbox (or
whatever folder it's currently in). This is because there is
a trigger that deletes messages if a new message is inserted
that has the same serverId and account.

Now, messages with duplicate serverId/account combinations are
allowed if one of the messages is in a SEARCH type folder.
Also, make a change so that when a message comes down in
a search result, we do also copy it into the primary mailbox
that message resides in, we only add it to the SEARCH folder.
Prior to this there was some code that intended to put
the search result message into the regular mailbox it's supposed
to be in, so that we'd have correct state in that message.
Unfortunately, there are several problems with this:
1. The code didn't work, it would make a copy in the regular
folder, and then unconditionally move it to the search folder.
2. If we leave this code in place, putting the message
temporarily into the regular folder still activates the duplicate
message deletion trigger, wiping out the original copy, even with
the update to the trigger.
3. It's unclear that it's even desirable to load the search
result message into the regular folder. It could be a very old
message that would not have been synced before, leaving a large
gap in your inbox, which is confusing and could interfere with
IMAP syncing.

Change-Id: I34671a3b677ab42a3efd0d170a6ebd9246ec493d
Perform Email2 upgrade at version 40.

 * DB was bumped to version 40 in 10.2, so make sure to upgrade.

Change-Id: I2c1631ce3ed6f0b64d9a45007a2e3f2259cd96b9
Merge tag 'android-4.4.1_r1' into HEAD

Android 4.4.1 Release 1

Conflicts:
	src/com/android/email/provider/DBHelper.java
	src/com/android/email/service/ImapService.java

Change-Id: I27fe83fabe89d0fd8fcbfced566aa36103f560e5
Email: PT-BR Translations

Change-Id: I6c6bcf047a3743ee89bd237541e3b749af01b5b9
Email: PT-BR Translations

Change-Id: I1696e47f54c4e3a5d94f7549d921de910232142c
Add missing "Notify for every message"...

Since Email now uses UnifiedEmail, this setting defaults to false
and there is no way to enable it; this commit adds this option,
which is then honored by the unified notification engine.

Change-Id: I5d4464026c6532c9aac87016368cf8e13d9cfbb5
Merge "Add missing "Notify for every message"..." into cm-11.0
Email: LT translations

Change-Id: Ice7d3ac4c80b1f3c295b5e463061da27efb3ed05
Email: Add new check frequency options (2h, 4h & 1 day)

- Ported from cm-9 & cm-10

Change-Id: Ia59f4e8db5e7458a0e12d5530c25589cc84a79bf
Email: ES translations

Change-Id: I9935f73abc0a4c68f973087fa5876afa6973ca37
Merge "Email: PT-BR Translations" into cm-11.0
Email: IT translations

Change-Id: Ia6c9e8c6e0e671aae4b902f1bbe746a9fa8ef9ca
Email: NL translation

Change-Id: I8569eda46a33c3315284ffb128882bf8a7abdd74
Email: PL translations

Change-Id: I7cd297df089339e8f28adbfb5061819458a113e2
Signed-off-by: jereksel <jereksel@gmail.com>
Merge "Email: PL translations" into cm-11.0
Merge "Email: IT translations" into cm-11.0