Wakelocks Misery
Android has improved at managing background processes in the last few years. Anyone who has used Android’s platform since the early days. Will tell you how bad things used to be when task killers were necessary. Even though Android isn’t subject to the same horrible battery life issues. The wrong combination of apps can still break Android’s elegant process management scheme.
Conventional wisdom used to be that you should open the multitasking interface. Then kill any application you’re not using to save battery life. Unfortunately, this superstition still persists. But Android knows how to manage background tasks; swiping apps out of the multitasking interface only closes the foreground process. If an app is indeed causing issues, it’s usually the background process that’s doing it. This sort of micromanagement will only waste time.
Awake or Sleep
The stock Android battery use menu can be helpful, but it only tells part of the story. Most apps show up here because you’re using them a lot; that’s to be expected. This menu shows you the system process app packages that use juice. But the Awake Screen on is the most important. If you have a lot more awake time than the screen on, something might be keeping your phone from sleeping. This is called a wakelock; it’s the number one enemy of your battery life.
When an app or service needs to run a process, it can wake the device with an alarm. The wakelock mode keeps the device awake so the app can do its business. This is usually no big deal; the app finishes up, and the device slips into a deep sleep. Conflicts bugs can cause wakelocks to persist, keeping your phone from sleeping. To figure out what’s messing with the battery, we need to find the root cause of this baffling case of smartphone insomnia.
Solving the case
It might not immediately be apparent that a phone is in wakelock for long periods. By all appearances, the screen is off; it seems asleep like it should be. One clue that something is going wrong is excess heat generation. When the device is cranked up instead of in a deep sleep. The device might be noticeably warmer than usual when you pick it up. You’ll need to do a little detective work. Although, that’s where the apps come in handy.
One quick, easy way to watch for a phone that won’t sleep is to use an app like System Monitor to track the clock speed. This app breaks down device activity as a percentage. Deep Sleep should be the most significant part of the chart unless you’ve been using the device almost constantly. If not, you’ve probably got a misbehaving app or system process.
You’ll have to dig a little deeper to determine the exact cause of your shortened battery life. The best app for this is BetterBatteryStats. The developer posts free beta builds on the XDA forums. Rooted users see more information in the app. But you can still get some data on wakelocks with almost all devices.
First, give the app a few hours to calibrate, then filter for Kernel wakelocks Since unplugged. If you see a process near the top of that list with a lot of wakelock time. That’s the guilty party. Kernel wakelocks are system processes like suspend_backoff or WLAN. (BBS) BetterBatteryStats sometimes includes links to more information about wakelocks with some ideas for fixing them. Otherwise, you can search for information on the exact system process to find a likely solution. Often, a reboot will knock some sense into your phone to clear this up.
Misbehaving Apps
Check for the Power Manager Service listing if you suspect a misbehaving app on your device. This is a catch-all for so-called partial wakelocks caused by apps. Rooted users can see the partial wakelocks in the app. Still, everyone else will have to do some detective work. Comparing recently installed apps to the onset of the Power Manager Service issue. To confirm, uninstall suspect apps. Create a custom reference point in BBS, put the phone to sleep, then check the wakelocks a little later. If Power Manager Service no longer eats up most of your sleep time, you’ve cracked the case. All done, gumshoe!
Wakelocks: Your mortal enemy.
More often than not, the root of your problem will be some app you installed. The easiest way to deal with the issue is to leave the offending app or game uninstalled. Still, maybe you want to use the app despite its battery-sucking behavior. In that case, you need a way to end the process safely. Android has a built-in form of hibernating processes; you can easily trigger it with an app called Greenify.
Use Greenify to identify the problematic apps, and hit the hibernate button after you use them. Greenify works best with root access; it can handle all this in the background. For non-rooted devices, you can use the in-app button or a widget to manually trigger the hibernation routine.
Going through this process might seem like a hassle. But it’s preferable to having a phone that can’t hold a charge. It can also save you from disabling valuable features like GPS or background sync. And squeeze a bit more life out of your device.