User: Password:
Subscribe / Log in / New account

Blocking suspend blockers

Blocking suspend blockers

Posted May 20, 2010 23:54 UTC (Thu) by brendan_wright (guest, #7376)
In reply to: Blocking suspend blockers by dlang
Parent article: Blocking suspend blockers

> the buggy behavior I expect is to raise the blocker for excessive periods of time (there has to be a way for multiple apps to raise the blocker at the same time, or the concept will fall apart in a multiprocess environment)

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.

(Log in to post comments)

Blocking suspend blockers

Posted May 21, 2010 11:03 UTC (Fri) by tialaramex (subscriber, #21167) [Link]

My understanding is that in the Android phone world what happens is this:

• 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.

Blocking suspend blockers

Posted May 21, 2010 12:57 UTC (Fri) by farnz (subscriber, #17727) [Link]

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.

Blocking suspend blockers

Posted May 21, 2010 15:58 UTC (Fri) by Aissen (guest, #59976) [Link]

HTC Hero running Android 1.5

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.

Blocking suspend blockers

Posted May 21, 2010 16:00 UTC (Fri) by farnz (subscriber, #17727) [Link]

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 © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds