We all understand there are things we do on our phones that will drain the battery faster. Streaming video, playing games, and using the GPS all cause the juice to flow out faster than we’d like. When we put our phone to sleep though, we expect the battery to drain very slowly. Software glitches can ruin that dream, sometimes emptying the battery in as little as a few hours. Researchers at Purdue have decided enough is enough, and set out to try to identify and mitigate the problems the bugs cause.
Read about what they found, and how they plan to fix it, after the break.
When smartphones enter sleep mode, they essentially shut down everything like the GPU, processor and the touchscreen. Some things need to be done occasionally while asleep though, like checking for new Words With Friends updates, so the system has built in APIs that developers can use to perform functions that won’t be affected if the phone is asleep. In Android, these APIs are called “wakelocks”, and this is where the problem starts for users. When well-meaning developers make an error in the programming, the phone cannot go back to sleep after performing a function and experiences massive battery drain.
The researchers studied 187 Android apps and found that 42 contained errors in the wakelock programming. Their method detected all known wakelocks, and discovered 30 more that were unknown. This is the first automatic check that has been developed, and could prevent all developers no matter how skilled from killing your battery while it sits in your pocket.
The researchers have created a modified compiler that can identify these bugs as it is being compiled, but there is no word yet on when (or if) it may become available to developers.