[Galaxy Note GT-N7000 Q&A, Help & Troubleshooting] AndroidSlave:
[HELP CENTER] How to prevent § handle wakelocks § save battery life[GUIDE] [β]​

Thread Purpose:

Information, help and support for those, who experiencing battery drain.​

Some of the material was taken from respective BetterBatteryStats thread -

Check it out

, for the sake of information and correct explanation. I take no credit for this info and grateful for it's existance.​

References and credits: [MENTION=4271370]ahalford[/MENTION] for all his hard work

&

: Chasmodo - you know, who you are!

For the info & software

: BetterBatteryStats creator & team

What is wakelock and why it may cause battery drain:

Wakelocks or to be more precise partial wakelocks is a pattern (in fact a class) than helps devs to make sure that important pieces of their code do not get interrupted.

Basically the phone has (simplified, kernel devs don't shoot) three states:

1. awake with screen on

2. awake

3. sleeping (that's you phone favorite state)

The transitions are from (1) to (2) and finally from (2) to (3). Now as long as you use your phone it's in (1) and does not leave that state as long as you keep using it interactively. If you stop using it the phone is aiming to go to (3) as fast as possible.

And here's where wakelocks are important: as our phones as smartphones they tend to do background processing. Some of this processing is important like e.g. making a phone call, listening to music or synchronizing your contacts.

As the phone wants to go from (2) to (3) and on the other hand you don't want to hang up while you are in a call the app keeps hold of a wakelock to prevent that transition. When you hang up the partial wakelock gets release and here we go (the phone goes to sleep).

So partial wakelocks is a tool and it's not something that we should forbid for obvious reasons. Now there are cases when the design on an app is not real life proven (conditions of poor of no coverage) and the wakelocks have negative effects because they are held unnecessarily or for too long.

How can we identify it?

BetterBatteryStats app identifies these wakelocks and using your expertise or the once from our users here you can understand what happens and find a strategy to change that for the better.

How can we eliminate it, if we found such?

The purpose of this thread - is support per situation, if solution has not been

found after reading FAQ & Tips section. You should provide BetterBatteryStats dump file, data about rom/kernel, (possibly) list of installed apps and describe your situation.

How to provide dump file:

[B]- Install the app and grant it root access.
- Plug/unplug the charger
- "Menu" - "More" - "Set Custom Ref." - creates a reference point
- Leave the phone with screen off for some time, 4 to 6 hours - this must be done so we can have uncluttered data as a basis for valid analysis
- Ensure you have the same wakelocks, that you've been about to report.
- Save a dump file - "Menu" - "More" - "Dump to file"
- It will look like - sdcard/BetterBatteryStats-2012-09-10_191252250.txt, for example
- Check that the chapters "Kernel wakelocks", "wakelocks" & "alarms"are populated.[/B]

I'm not posting the app FAQ on purpose - those, who can't handle it, can just provide a dump file. Those, who can understand or learn fast - don't need it:cool:

But. Brief explanation, about where to look at the wakelocks:

1.Set your reference as "Since unplugged" in the second line.

2. Then, in the first line: "Other" - look at the "Awake" vs "Screen on". If it differs a lot, continue with a drill-down.

3. First line - check under "Partial Wakelocks" and "Kernel wakelocks".

4. "Menu" - "More" - "Raw kernel wakelocks"

5. For more help: "Menu" - "Help" - "Getting started" or "How to".

6. Same web links:

Help:

http://asksven.github.com/BetterBatteryStats-Knowledge-Base/help.html

How to:

http://asksven.github.com/BetterBatteryStats-Knowledge-Base/howto.html

App Screenshots:

[/FONT]

Want to install Cyanogen or AOKP rom and have questions? Get here.