Big delay using Intent.ACTION_HEADSET_PLUG when the device is sleeping
<p>I have some troubles using a <code>BroadcastReceiver</code> when the device is sleeping. 
I use this code in the <code>OnReceive</code> metod:</p>

<pre><code>public void onReceive(Context context, Intent intent) {

    Intent i = new Intent(context, ConnectionActivity.class);

    PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
    wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK |
        PowerManager.ACQUIRE_CAUSES_WAKEUP , C.WAKE_UP_TAG);
    wl.acquire();

    i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    context.startActivity(i);
}
</code></pre>

<p>When I plug in the headphone and the screen is off, there is a delay between 5 and 30 seconds until the screen turns on. </p>
