Fix a Cursor leak

When cursor is done, the cursor must be closed to avoid cursor leak.

AOSP: https://android-review.googlesource.com/#/c/54993/

Change-Id: I8d837dd50473c3b14806f54ca8a78de14178b0cb
avoid cursor leak in email provider

When cursor is done, the cursor must be closed to avoid cursor leak.

Merged by AOSP: https://android-review.googlesource.com/#/c/52910/

Change-Id: Iaaffed2c4e90dc4b17ae55fcedb242bf890b3dd5
Fix SMTP RFC violation for better interoperability

Space after colon violates RFC 5321 (and RFC 821): "Since it has been a common
source of errors, it is worth noting that spaces are not permitted on either
side of the colon following FROM in the MAIL command or TO in the RCPT command"

Change-Id: Ie5330bf2bd01cd8f734134dadd742cf16df70d7a
Signed-off-by: Jack Bates <jack@nottheoilrig.com>
Merge "Fix a Cursor leak" into jb-mr1
Potential NPE in Account.

Also, avoid calling close() if the cursor is already closed.
Signed-off-by: Sylvain Becuwe <sylvain.becuwe@gmail.com>

Merged in AOSP: https://android-review.googlesource.com/#/c/45703/

Change-Id: I5e077a03e437721b8fc7ffb9af284eaa405d901e
email: "Exchange Services has stopped" - Rain of Exchange Javacrashes

Cleanup some nasty records containing NULL fields.

Author: Emmanuel Berthier <emmanuel.berthier@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 60461

Merged in AOSP: https://android-review.googlesource.com/#/c/47571/

Change-Id: Iec5e7e1bebc4beee8fa010c3f9c9ee723fd2cd83
Force close_crash happened when add new mail from Email widget

rootcause: The widget store a email account id when Launcher add a email widget.
If the email account is removed, but the widget acount id is still exsit.

Change-Id: I4b18e19506ed6afe5d24ab44585cd58c37e221f0
Author: Erjun Ding <erjunx.ding@intel.com>
Signed-off-by: Erjun Ding <erjunx.ding@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 36835
Merge "Fix SMTP RFC violation for better interoperability" into jb-mr1
Merge "Potential NPE in Account." into jb-mr1
Merge "email: "Exchange Services has stopped" - Rain of Exchange Javacrashes" into jb-mr1
Merge "Force close_crash happened when add new mail from Email widget" into jb-mr1
Email: Dark UI changes

Email: Slim goes TRDS

cheers

Change-Id: I30b95842c7ac229bbe3c16676c660e772ffbae28
email occasionally crash on boot complete

Email.setServicesEnabledAsync()
  --> create EmailProvider.db     (1)
  --> setLocaleFromConfiguration  (2)

Because Email.setServicesEnabledAsync runs async, the following
`checkDatabases` may occasionally delete the EmailProvider.db between
step (1) and step (2), which will crash `setServicesEnabledAsync' in
step (2).

`checkDatabases` before `setServicesEnabledAsync' to avoid the race condition
Merge "Revert "Restore the account using SetupData after rotating the screen.""

Change-Id: I034b6cfcecd856bc31476de0d91acb1e3369d69b
Merge tag 'android-4.3_r2.1' of https://android.googlesource.com/platform/packages/apps/Email into 'jb-mr2'

Android 4.3 release 2.1
Also allow hidden method access.

http://review.cyanogenmod.org/#/c/49689/ requires the chips library to
need access to hidden methods, so the email app needs access to those
too.

Change-Id: If11c44b99a650f0fab958d37a3cdedc6cee3a317
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