On Sun, Jan 3, 2010 at 10:53 AM, Carter <ccjerni...@gmail.com> wrote:

> What's the definition of "background" in terms this scheduling mode in
> Android 1.6 or later?  Is it based on this document?
>
> http://developer.android.com/intl/fr/guide/topics/fundamentals.html#proclife


 Yes, any process not in the foreground or visible scheduling classes (that
is not directly interacting with the user) has its thread put into the
background scheduling class.

The follow up question is: if a service is a foreground service (e.g.
> has called startForeground()), will it consume more CPU than a service
> that has not?
>

It will be considered to be a foreground process, so its thread will not be
forced into the background scheduling class.  Whether it consumes more CPU
is really dependent on the two services -- but if they are both trying to
use 100% of the CPU and have not otherwise adjusted their thread priorities,
then the foreground one would get most of the CPU time (90% or even more).

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to