Do not treat Settings failures as provisioning errors.

Bug: 11243543
Change-Id: I609b6d3d23882d0b308d37c06d393a49a25ff1a7
Do not trigger full sync on push_only requests.

Bug: 11249423

Change-Id: I1285581bf9208b7ee222013d21e07eb9f8bb56e8
Handle all possible exits of the PingTask.

- If we get an exception, reschedule the ping instead of just dying.
- If the task was cancelled, also reschedule.

Bug: 11249423
Change-Id: I74a39e04de73659d58f1c53b238f8a40f15d6849
Do not reuse old connections.

- Only keep connections in the cache for a limited time
  (currently 10 minutes).
- Always get connection manager from the cache, don't keep
  a reference in the EasServerConnection.

Also add some logging.

Bug: 11249423
Change-Id: I7c7da95745770fd2cb3ba58d63fc1fcdcc8eb232
Opt out Exchange from restricted profiles.

Bug: 11271155
Change-Id: I29d07fcd31b36bec1efb9b124b6ff612c078c889
Ping fixes.

- Clear the EasServerConnection's client whenever the ConnMan
  changes.
- Restart ping on generic errors as well.

Bug: 11249423
Change-Id: Ie6b661bec0f5d6176b01050201c514dca463aebf
Treat "fetch needed" same as "more available" for sync.

Bug: 11245727
Change-Id: I57c10e6994fd6d31f3433cdd291e338fb7eb3205
Don't ping or sync if we're on security hold.

We still allow FolderSync since that's one of the ways to
clear the security hold.

Also, correct a minor error in ping backoff logic.

Bug: 11752556
Change-Id: Ide432ac5594dd02edab69677c2379865d602ed45
Merge tag 'android-4.4.1_r1' into HEAD

Android 4.4.1 Release 1

Conflicts:
	src/com/android/exchange/eas/EasConnectionCache.java
	src/com/android/exchange/service/EasServerConnection.java
	src/com/android/exchange/service/EmailSyncAdapterService.java

Change-Id: I39caad96623da4d871638051186aa99bb38441e1
Translated missing line to Russian

Change-Id: I249ce44431f80c820667adaa47fc6613b9a00c4c
exchange: Prevent policy provision NPE

If the EAS server fails to resolve provision, canProvision will return null,
which will make crash exchange account wizard trying to attach the policy
to VALIDATE_BUNDLE_POLICY_SET. Just return a NO_POLICY.

aosp change-id: https://android-review.googlesource.com/#/c/78695/
JIRA: CYAN-2356
Issue: https://jira.cyanogenmod.org/browse/CYAN-2356

Change-Id: I2ba3cab33fecf5a75e90e8254653556dd00a3738
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Fix mismatched function arguments in Contact query

addNameRow's last four arguments are
    accountName, displayName, firstName, lastName
while here it's called as if they were
    displayName, firstName, lastName, displayName
This was causing Exchange copied contacts to have the wrong format.

Also, addPhoneRow gets called with displayName instead of accountName as
the function signature says.

Change-Id: I249529b7ce2cfacc713a62a6aee46bbfb36bf4f3
Signed-off-by: Iago López Galeiras <iago@endocode.com>
auto-merger: merge in from slim/kk4.4