title: Force an android phone to sleep, in order to test?
body: <p>I'm writing an android application that depends on network activity and the alarm manager sometimes waking the phone up from a sleeping state.</p>
  
  <p>My question is how can I reliably test this on device? Ideally, how can I force the phone into a full-on sleeping state. Failing that, how can I know for sure when the phone has fully gone to sleep?</p>
  
  <p>How do you test your Alarm Manager / Wake Lock / Sleep handling code?</p>