On Mar 31, 10:29 am, Mark Murphy <[email protected]> wrote: > On Sat, Mar 31, 2012 at 10:18 AM, Put_tiMe <[email protected]> wrote: > > On some devices, like the Sony Erricson Experia, if I long press the power > > button, I get a UI menu, with a sleep mode option. > > > What would be the difference between that sleep mode and the screen-off > > sleep mode? > > Nothing. That option is in the menu in case you accidentally > long-pressed the power button instead just pressing it. > > > On screen-off, i.e. when it hits the sleep mode, are the wifi radios and CPU > > disabled/switched-off? > > The CPU stops running.
This is demonstrably wrong, as you can have a PARTIAL_WAKE_LOCK held and not have the screen on (or even just have ADB gathering logs even after the short/long power button press to turn the screen off.) The only thoughts I've had on being able to reliably say "I've tested my AlarmManager/Wake Lock code across Screen/CPU states for device X" is to have a non wake lock holding thread that stores a heart beat value somewhere and compares that to the last one (and if the distance is more than expected, you can guess that the OS let the CPU stop.) If your alarm code repeatedly works during a period where the heart beat was not running, it's probably good. You should probably test on a clean device in airplane mode, with all the "background update" options that you can find set to never, and check the output of "adb shell dumpsys alarm" to see if your test case just got lucky and somebody else had an alarm that went off and let you do your things for a few cycles, or if your alarm code really did wake you up when you wanted. If it was production code I'd really want to test against each of the OEM flavoring (Sense/Blur/Touch etc) because things like HTC's fast-boot power saving modes won't act the same as a stock Nexus S on AOSP. > WiFi behavior will vary by device and user preference. This was > discussed recently: And the Radio processor can be a different story as well. Dan Schmitt -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

