Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
PostgreSQL 9.3 beta: Federated databases and more
LWN.net Weekly Edition for May 9, 2013
(Nearly) full tickless operation in 3.10
Blocking suspend blockers
Posted May 20, 2010 23:54 UTC (Thu) by brendan_wright (subscriber, #7376)
This is a potential problem. One advantage Android has is that most apps are installed through a market where user comments can indicate to others that software has these kinds of bugs (which should be pretty rare as most code shouldn't need to operate with a suspend block taken).
A user who notices that the problem is occurring could manually kill the app. However they won't always be paying attention to the device.
A battery operated device will eventually die through lack of power anyway, so perhaps devices should choose to ignore an apps suspend-blocking request after a certain amount of battery is consumed. This sort of functionality might seem unnecessarily complex in the desktop world but could be a life-saver in the world of battery operated devices.
Posted May 21, 2010 11:03 UTC (Fri) by tialaramex (subscriber, #21167)
User A downloads "cow bouncer" and is impressed that now their phone constantly has bouncing cows. However an hour later their phone bleeps to warn the battery is low. The "low battery" screen shows a "Why so soon?" button or link, which implicates "cow bouncer" as the reason. User A chooses to uninstall the "cow bouncer" app because it's a waste of battery life.
User B downloads "John the ripper Android edition" and sets it to work cracking password hashes. An hour later the phone bleeps due to exhausted battery. User B plugs it into the wall, he doesn't ask why because hey, he was running a password cracker on his phone, stands to reason it will exhaust the battery.
By obligating ordinary developers to ask for this functionality if they need it and then auditing how it is used, Android make them responsible to their users - if you need to block suspend for long periods, you will need to educate your users about why that is, and persuade them that the app functionality is worth the reduced battery life, otherwise they're going to throw your app away and probably warn off other potential customers.
Posted May 21, 2010 12:57 UTC (Fri) by farnz (guest, #17727)
Close, but not quite for the HTC Hero running Android 1.5. When you download "cow bouncer" or "JTR Android", you get warned that the application can "Prevent the phone from sleeping", and have to say OK or Cancel to the "install anyway" prompt.
There's no in-built UI for catching bad apps, but there are third party applications in the Market that use the existing API to tell you which applications are using power - they're spotted not because they're CPU hogs, but because they're holding a wakelock preventing the phone from sleeping.
Posted May 21, 2010 15:58 UTC (Fri) by Aissen (subscriber, #59976)
Although it was released just over a year ago, Android 1.5 is a pretty old in the Android timeline.
Wonderful things have happened, and three releases later Android 2.2 have been announced officially yesterday.
HTC promised to update the Hero to Android 2.1, and hopefully you'll get it sooner rather than later, and see the UI everyone's talking about in the default OS.
The most important is that susupend blockers are merged so that the future of Android is one where upstream matters, and Android kernel is no longer a fork.
Posted May 21, 2010 16:00 UTC (Fri) by farnz (guest, #17727)
Android 1.5 is the latest version available for my device; I cannot in fairness tell you how Android behaves without qualifying it with the version number, because I can't tell you if it's been improved in later versions.
However, I'd hope that in this respect, Android isn't regressing in new versions. Power management is kinda critical on a phone.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds