[Q] Exchange Services Battery Drain

Rlin5741

Senior Member
Aug 27, 2011
104
12
0
I am getting what seems to be a fairly common issue for people (via searching on Google) in excessive Exchange Services battery drain. The keep awake related to Exchange Services right now is about 3.5 hours, on a total of 4 hours of total time after taking it off. The phone has been awake the entire time I have had it on, due to Exchange Services. I also can see com.android.exchange and com.android.email show up constantly if I go into Developer Options and enable the Show CPU Usage. The oddest thing is that this did not appear when I first set up my Exchange email (to the same exact settings) when I got the phone a week or two ago, and only cropped up when I did a factory reset this weekend. I have already taken the following trouble shooting steps:
- removed and re-added the account
- removed account, cleared data and cache for exchange services, restarted, then re-added the account
- Switched to something other than push for sync frequency. This DOES fix the problem, however not having push is not, in my mind, a workable solution since I do have IM-like exchanges over email that require more real time back and forth. There was a reference on AndroidCentral with a user that switched to non-push for an hour, then switched back and push started working normally; for me this did not work (I left it on non-push overnight)
- Logged into OWA, manually removed account, then removed account/cleared data/restarted phone, then re-added the account. Note that I did this through the OWA system, I did not go into the Exchange Management Console (I do not have access to that) and remove/re-add the account.
- Disabled Tasks or Calendar sync. Neither works - its clearly related to the email portion of the exchange server sync.
- Removed Outlook.com app

I realize that I can use a third party app for Exchange, but then I will have completely segregated exchange calendar/contacts from the system calendar, and that is not something I want (i.e. I want to see gmail and exchange events side by side).

Hopefully the early adopters on this forum will have some good input regarding this issue. There is a fair amount of people out there asking for help on this problem, but some have it go away by removing/re-adding the account, but a good chuck of them appear to never solve their issue. Hopefully that is not me....
 

Rlin5741

Senior Member
Aug 27, 2011
104
12
0
Solved my issue...this was what I did, for the record:

  1. Remove the external memory card on my device (to prevent remote wipe from deleting the files on my external memory card – i.e. pictures)
  2. Go into the Phone List on the Outlook Web Access and initiate a remote wipe
  3. Step 2 obviously triggers a factory reset of my phone. Once that reset took place and I got the confirmation email, I removed my phone from the Phone List on Outlook Web Access per the email’s instructions. If you do not do this, then your phone will simply wipe and reset again when you try to reconnect to the exchange server
  4. I re-set up my phone, re-downloaded all of my apps, and re-added the exchange account

Within step 4, this is what I did:
  1. I am not sure this step is essential, but I did not select the option to allow Google to restore my backed up settings – I started completely fresh
  2. Because I did not restore my backed up settings, I went through the process of re-setting up my phone, which took some time – probably about an hour or so since I was doing it off and on. During that time, Google may have pushed out other updates to my phone (I know from past experience that Google tends to do that when the phone is first set up). After that hour, I re-added my exchange account (using autodiscover)
  3. I used the default settings at first when setting up the exchange account (default on my phone was 3-day sync of email, 50kb limit per email, and 2 week sync of calendar). After I saw that there was no more error loops causing the exchange services to run constantly, I changed this to my preferred settings (1 month email, no size limit, 6 months calendar, sync of sent items and my Axial subfolder in addition to inbox)
  4. I am not sure if the order matters, but I reset-up my main phone settings before re-adding the exchange account, and re-added my apps after adding the exchange account.

The OWA interface where you can delete, execute remote wipe, etc, is simply the web address you use to log into your exchange email (i.e. it is not an admin tool). For me, it was the format owa.domain.com, but it will be different for every server. I was able to grab phone log and the OWA log both while I had the battery drain issue and after, and I have our IT guys looking into it. In the meantime, if anyone here is an IT expert, particularly an exchange expert and may find these logs to be useful in diagnosing the root problem, please PM me. A cursory glance of the logs confirms an error loop, with the server showing a lot of these errors:

Command_WorkerThread_Exception :
--- Exception start ---
Exception type: Microsoft.Exchange.AirSync.AirSyncPermanentException
Exception message:
Exception level: 0
HttpStatusCode: OK
AirSyncStatusCode: Search_TooComplex
XmlResponse:
<?xml version="1.0" encoding="utf-8" ?>
<Sync xmlns="AirSync:">
<Status>8</Status>
</Sync>
Exception stack trace: at Microsoft.Exchange.AirSync.SyncCommand.OnExecute()
at Microsoft.Exchange.AirSync.SyncCommand.ExecuteCommand()
at Microsoft.Exchange.AirSync.Command.WorkerThread()
Inner exception follows...
Exception type: Microsoft.Exchange.AirSync.AirSyncPermanentException
Exception message:
Exception level: 1
HttpStatusCode: InternalServerError
AirSyncStatusCode: ServerError
XmlResponse:
[No XmlResponse]
Exception stack trace: at Microsoft.Exchange.AirSync.RecipientInfoCacheSyncCollection.OpenSyncState(Boolean autoLoadFilterAndSyncKey, SyncStateStorage syncStateStorage)
at Microsoft.Exchange.AirSync.SyncCommand.SyncTheCollection(SyncCollection collection, Boolean createSubscription, Boolean tryNullSync)
at Microsoft.Exchange.AirSync.SyncCommand.OnExecute()
--- Exception end ---
and the Request Header is largely the same, except for the one that generates the loop has a line that says

Connection: keep-alive
Content-Length: 38
while the one after the fix says

Connection: close
Content-Length: 296
The phone side log looks very different between the one that constantly syncs and one that does not.
 
  • Like
Reactions: Redflea