Alarm does not work when phone is in deeply asleep
<p><br>
I have an Alarm App that works perfectly 
except when the phone is deeply asleep. <br>
When truly asleep my alarm activity shows up <em>after</em> the user wakes up the phone. I want the phone to wake up the user...<br></p>

<p>The app starts my AlarmAcivity directly from a BroadcastReceiver. (Not from a Service.) <br></p>

<p><br>
One clue:<br>
Log D <strong>DeepSleepService</strong>:  AlarmManager go out of deepsleep<br>
...<br>
<br>
PowerManagerService: putReleasedWakeLock<br>
PowerManagerService: <strong>*</strong><em>mAcquiredLocks contents</em>****<br>
PowerManagerService: LockList entry : flags=0x10000006 tag=com.solidllc.foo.WakeLock<br>
PowerManagerService: LockList entry : flags=0x1 tag=RILJ<br>
PowerManagerService: LockList entry : flags=0x1 tag=<em>network-location</em><br>
PowerManagerService: LockList entry : flags=0xa tag=KEEP_SCREEN_ON_FLAG<br>
PowerManagerService: putReleasedWakeLock --> remove partial wakelocks into list, size i<br>
...<br>
<br></p>

<p>//<br>
//My manifest:<br>
android.permission.INTERNET<br>
android.permission.WAKE_LOCK<br>
android.permission.DEVICE_POWER<br>
android.permission.DISABLE_KEYGUARD<br></p>

<p><br> 
The Alarm Clock that comes with Android has the above plus: "Modify global system settings" and "Retrieve Running apps". <br></p>

<p>Anyone know what can be done?<br></p>

<p>Thanks much.</p>

<p>Here is the code that sets the alarm:</p>

<pre><code>void armAlarm(int hour, int minute) {

    Calendar alarmtime = new GregorianCalendar();

    alarmtime.set(Calendar.HOUR_OF_DAY, hour);
    alarmtime.set(Calendar.MINUTE, minute);
    alarmtime.set(Calendar.SECOND, 0);

    Intent intent = new Intent(RatActivity.this, AlarmReceiver.class);
    PendingIntent pi = PendingIntent.getBroadcast(RatActivity.this, 0,
            intent, 0);

    AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
    am.cancel(pi);
    am.setRepeating(AlarmManager.RTC_WAKEUP, alarmtime.getTimeInMillis(),
            AlarmManager.INTERVAL_DAY, pi);
}
</code></pre>
