Just a quick note here as I had to do a lot of digging to fix this issue.
Issue: HTC Diamond (potentially other models) not waking up from “sleep mode” when you have an email send/receive schedule. Instead, when you wake the device up it establishes a connection immediately and performs the check.
Problem: It appears the root of the problem are two registry settings that define how long a process is allowed to attempt to wake a device from sleeping before it is terminated by the OS. Evidently checking email takes a number of seconds. I’m not sure what the default value is in a stock ROM, but in a few of the custom ROMs I’ve used this value is 1. 1 seconds generally is not long enough.
Solution: Change the following registry settings to a value in seconds that represents the tasks you’re expecting to wake up your device. I’ve got my device set to 15 and it happily collects email while sleeping and provides a glowing / audible notification.
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\Timeouts] “BattResumingSuspendTimeout”=15 “ACResumingSuspendTimeout”=15