Hardware button press event while device is sleeping
<p>I am developing a security application. When the user presses a hardware button for a specific amount of time an action will occur. </p>

<p>I need to a react to the press of a hardware button like Power or Volume. 
My application has to work in the background without requiring the user to unlock the screen. The problem is that I cannot catch the event when the button is pressed while the device is 'asleep'</p>

<p>A scenario could be that the user pushes the power button for 3 seconds, which causes an email to be sent.  </p>

<p>The <code>KeyEvent.KEYCODE_POWER</code> doesn't work in a service and activities are either paused or destroyed. </p>

<p>Any Idea how to solve my problem?</p>

<p>Is there any <code>BrodcastReceiver</code> to realize this?</p>
