[HD2 Android SD Development] Yank555:
[FIX (Workaround)] ~60mA battery drain issue

Hi,

I've been doing some investigations into this issue, and am very happy to report, that I am now "in control" of the problem. It is not a solved issue, but I now can cause the drain, and also more importantly circumvent it !! :cool: :D

In short, Bluetooth has to be disabled in Android when Android boots. If it is, the stand-by drain (with BT / WiFi / Phone enabled after boot) won't be higher than 10mA, mostly between 5 to 8 mA !

If on the other hand BT was enabled in Android while booting, you'll face the ~60mA stand-by battery drain :mad:

Here is a step-by-step procedure to get to the low (normal) battery drain :

As a sidenote, my WinMo was in airplane mode, dunno if that has any impact, but I'd suppose it has none... (will check that when I have some spare time).

1) In Android (when facing the drain or not) disable BlueTooth using a widget, settings ...

2) Power cycle (shut down and restart the device)

3) Let WinMo start normally

4) Use your favortie Android loader to start Android

5) Once Android is up & running, enable bluetooth (WiFi / Phone / 3G... whatever you need)

After letting Android startup completely, put the phone in stand-by for a few minutes, and check the drain, it will be between 5 to 10mA (have seen up to 12mA, maybe some apps being active...).

Anyhow I did a field test this WE. I traveled around 500km (one way), BT enabled and actively connected to the handsfree system of my car. I crossed 3 borders, phone and 3G active, so the cell phone did a lot of cell switches, operator switches etc. I've used my HD2 normally to make phone calls, surf the Internet using WiFi in a restaurant, send SMSes, played some Angry Birds etc. over 16h later I still had 61% battery left !! Stunning, this is better than WinMo,

way

better !!

I was able to repeat this today on my way back, and also during my stay.

What didn't work for me :

- formating the SD card

- choice of SD card (same thing whatever card I've tested)

- removing and reinserting the SD card while in WinMo just before booting Android

- task killers

- using manual brightness (putting it the lowest value given ambient light manually)

What may have had an impact (I don't believe it had, but you never know) :

- registry tweaks in WinMo to put devices to sleep, BT, Network ...

@mccmjoon76 :

Maybe it's possible to disable BT by script right after the kernel starts and enable it again as late as possible ?? I am not familiar with Android booting, and maybe after the kernel starts is already too late, but it's sure worth a try ;) On a Linux System I'd go looking at the /etc/rcx.d script links...

Now one last issue to go for and this build is and will stay my default OS on my HD2 for a

very

long time :cool:

I need to get VPN (PPTP) to work over mobile data (it does only over WiFi for the moment)...

Hope this helps, JP.

PS: I use JuiceDefender to further extend battery life and have found it to be very usefull on this build and also on the stock rom of my ASUS TF101...

PPS: This may also work with other builds ... if you face this issue, give the above a try ;)

Update 29/08/2011 :

I've switched on GPS on top of WiFi, 3G, BT, phone ... and put the phone to stand-by. First time I checked after a few minutes stand-by, I had only 7mA drain :cool:

Update 31/08/2011 :

The drain was back again today, impossible to circumvent it any way I tried :mad:

I suspect it is the new version of JuiceDefender beta (which includes Bluetooth auto-switching) which is activating bluetooth too soon on boot somehow, but not sure though, this needs a little investigation further.

I reverted back to the previous version (from a backup), low drain was there again, updated every app except JuiceDefender, the drain was still low...

Will check this (backup and update JuiceDefender again) and keep you posted...

It's probably best to stick with the non-beta version of JuiceDefender for now.

Update 01/09/2011 :

Wrong assumptions I guess, the ~60mA drain seems to be the consquence of GPS, not Bluetooth :( Although I repeated both of my tests several over and over again, and it was persistent then :confused:

--> http://xdaforums.com/showpost.php?p=10636518&postcount=125

I also found a thread on another forum, wherein GPS is accused of being the problem, in general, not only on HD2 ports of Android but also on genuin Android devices. Applications activating it might not disable ot correctly (assumption 1) or the device not letting itself disable correctly (assumption 2). Many seemed to be able to reproduce this ... so it sounds trustworthy.

I suppose I was just "lucky" over the last WE that it worked out that well...

Will continue to dig into this and keep you posted.

Update 04/09/2011 :

OK, back to Bluetooth as the cause, since I've tested the latest AmreiCan Android release and I can persistently have in stand-by 60mA with BT on, 10mA with BT off. On NexusHD2 v3.0 tytung's latest kernel includes a BT drain fix, and this works fine, with everything on standby drain rarely goes over 10mA, so that's that ;-)

==> Tytung's latest kernel details

==> Bluetooth drain fix

@mccmjoon76 :

- Would this kernel work with this build ?

- Could the patch be applied to hastarin's kernel ?