Originally posted by Dukenukemx
View Post
The problem here is that one may look at global state, device state, processor state, and performance state.
SUSPEND is part of a GLOBAL state. Specifically, G1-S1 is the first mode of "Suspend". Note that G1-S1 "Power on Suspend", permits the CPU to remain in a clocked-on state. G1-S2 requires the CPU to be powered off. "Suspend-to-RAM", which I believe is what you are referring to, is G1-S3.
Now CPU states, C0: fully online. C1: halt = clocks on, but execution "halted". C2: optional "stop clock". C3: SLEEP.
While it may be true that some of the EARLIER Android devices did NOT stop their clocks (i.e. HTC Dream MSM7201A), since the first Snapdragon devices (and similar), Android devices typically put the CPU into C3 while idle. If you install a program called "CPU Spy", look at the line called "Deep Sleep". That is corresponding to CPU state C3. All CPU clocks are stopped, and L2 cache clock is stopped.
So, while your claim that Android doesn't "suspend" is based on the CPU being online, your contention that it doesn't suspend because it doesn't clock off, is false for TWO reasons; first that disabling CPU clocks is a requirement for "suspend", which it clearly is not, and second, that Android devices don't shut off their CPU clocks, is also false.
Android devices most certainly DO suspend, but they are not always suspended just because the screen is off. All that can wake an Android device from suspend is an interrupt. Interrupt can be in the form of power button, incoming phone call, alarm timer, etc.
Edit: If you look into Android power management, even very superficially, you will find something referred to as a "wake lock". What a wake lock does, is it prevents the device from suspending! If you look at complaints about low battery life, most of these will tie into something obtaining and failing to release a wake lock, i.e., preventing the device from suspending.
A wake lock is defined in userspace PowerManager. It was implemented in API level 1, which corresponds to Android 1.0, which shipped on the HTC Dream. Yes, even though it did not shut off its CPU clock, it still SUSPENDED. You can see the different types of wake locks you can obtain here: https://developer.android.com/refere...erManager.html
In addition to the userspace component of wakelocks, there is also the KERNEL component.
Comment