Monday, June 4, 2012

Re: [android-developers] The confusion about android sleep mechanism

If you need to keep the CPU running, that is what a partial wake lock is for.  The other wake locks do different things -- for example a full wake lock keeps the screen on; though the screen being on will prevent the CPU from going to sleep, the user can manually press the power button to force the screen off and stop that.  So different locks for different purposes.

On Mon, Jun 4, 2012 at 6:42 PM, ilikeB2 <zhengji1983@gmail.com> wrote:
when debugging Android 4.0 board encounter a problem: I have add a
proximity sensor lock, but the device will still sleep down.

I haven't payed attention to this problem on 2.3, so i read
powermangerservice.java and found in function acquireWakeLockLocked,
the judgment function

if (isScreenLock (flags))
{
}
else if (PowerManager.PARTIAL_WAKE_LOCK)
{
     Power.acquireWakeLock (Power.PARTIAL_WAKE_LOCK, PARTIAL_NAME);
}

It seems that only  PARTIAL_LOCK  calls "Power.acquireWakeLock()"
which tell kernal to have lock ,  but the FULL_LOCK/PARTIAL_LOCK /
PROXIMITY_LOCK doesn't call the function.


So i wonder to know how does the other kinds locks besides
PARTIAL_LOCK let kernel know its lock state. so that the device can
control its sleep state?

Thanks.

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en



--
Dianne Hackborn
Android framework engineer
hackbod@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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate