Monday, March 26, 2012

Exchange Battery Consumption on Android

[Update II - April 2, 2012]

In my case, it is definitely directly related to certain email messages.

I've had the problem on a Nexus S, with various ROMs, and on a Galaxy Nexus, stock.  In my case, it seems to be directly related to certain emails.  That is, when I receive a certain email, it will hang the connection and kill the battery.  In my case it is a status email I receive from a server 7pm every day.  It has some fishy header info, and Outlook reports that it may be a phishing message.  I move this email into a folder that doesn't sync with my phone, and all is good.

I wonder if this is due to an Exchange update, or an update that is in all Android code now...  If it is in the android code, it must be pretty low level, as I've read reports that people using Touchdown are also experiencing the same issue...

[Update - March 30, 2012]
My theories below didn't last.  The issue reared it's ugly head gain.  I have a new theory, though.

Right about the time this started I had set up a cron job on a linux box.  Part of this cron job sent me some emails using the ssmtp app on linux.  I configured ssmtp to rewrite the email address so that it would look like it was coming from my home domain.  When these messages are received in Outlook/Exchange they are tagged as potential Phishing threats.  When I click on the warning in Outlook, there are various options to resolve the issue.  My latest theory is that Android/Exchange are choking on the transfer of these messages that are marked as Phishing threats.  When I mark the message as safe, it seems to transfer normally.  If I leave it tagged as Phishing threat, Android Exchagne client spins and Exchange services sucks the battery...  I'll test this theory for a few days...

---

About 1 month ago, I started noticing heavy battery drain on my phone (Nexus S, Cyanogen mod 9 RC).  I hadn't changed anything in the days leading up to the failure.  This was completely abnormal battery drain - like 30-40% in one hour, the phone getting hot.  Email would no longer sync with my Exchange account.  While in the email client, the syncing icon would just continue to spin.  When I went to battery use, Exchange Services was using approx 50%.

I tried many things to rectify this.  Deleting and recreating the account on the phone.  New/different versions of ICS.  Different versions of GApps.  Disabling/Enabling various combinations of email, contacts, and calendar for syncing.  Changing from push to never and various settings in between.  Nothing seemed to make any difference.

Fortunately for me, I had access to the exchange server (in my case SBS2003).  I hoped if I could get at some detailed logging there, I might be able to figure out what was causing the problem.  In trying to enable and configure more verbose logging, I came across a tool called, Microsoft Exchange Server ActiveSync Web Administration Tool.  It can be found here.  I installed this on my Exchange server, hoping it might shed some insight, or show me some more log info, or something...

Once I had it installed and working (I had to use FF to view the page; it wouldn't work in IE for me), it showed many ActiveSync accounts for my mailbox.  These were maybe 10-15 "accounts" dating back 5+ years, showing many different phones that I had had.

I should note here, that the idea of this tool is to allow remote wiping (for example, if a phone was stolen).  Anyway, I started deleting all these accounts from the oldest to the newest.  Once I had deleted them all, it seemed my phone recreated the ActiveSync account, and since then all has been well.  My phone is behaving normal again.  Exchange email/contacts/calendar are all now syncing once again, and not draining my battery.

Maybe this will help some others as well...

7 comments:

Anonymous said...

Thanks for the tip!

Without admin access to the server, do you know if there are several ActiveSync accounts attached to ones Exchange account?

Anonymous said...

You can view what phones are associated with your account via Outlook Web Access. Login and then go to options - see all options. Then click "phone" on the left hand side.

avp said...

While cleaning up the accounts seemed to help me for a while, please see my new theory above... The account cleanup may have been related or just a coincidence...

YoKaay said...

I checked OWA Phone settings. It had multiple entries. Hope keeping just latest entry helps. I am running latest CM10 from Quarx on Motorola Defy+

YoKaay said...

I checked OWA Phone settings. It had multiple entries. Hope keeping just latest entry helps. I am running latest CM10 from Quarx on Motorola Defy+

Trevor Larkin said...

any progress AP?

i get this issue only when roaming which narrows it down a bit.
i also have access to my exchange server and i have..
1)deleted all my old phones
2)i have found the settings i think can be altered to solved the problem (see link)
https://www.box.com/s/xw2u0bws5iuuzut3uk55

have you tried these?

thanks
t

Alex Bandit said...

Thank you and looking for more posts. I am really satisfied with this posting that you have given us. This is really a stupendous work done by you. blackberry app development