Monday, June 4, 2012

[android-developers] The confusion about android sleep mechanism

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

No comments:

Post a Comment