diff options
| author | Chris Tate <> | 2009-04-02 23:15:58 -0700 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2009-04-02 23:15:58 -0700 |
| commit | a34df8a2ba450b2c2ad83ccbbac30b80e2706bb2 (patch) | |
| tree | 818ce720dd227540ad98763c0bda8e30ac1c6e77 /core/java/android/app/AlarmManager.java | |
| parent | 5cb6f988b2423f4c2ce4445132fd7f3295f6efb7 (diff) | |
AI 144405: am: CL 144307 am: CL 144306 Fix SDK issue 1716562 - Broadcast mechanism documentation should be improved.
Original author: ctate
Merged from: //branches/cupcake/...
Original author: android-build
Automated import of CL 144405
Diffstat (limited to 'core/java/android/app/AlarmManager.java')
| -rw-r--r-- | core/java/android/app/AlarmManager.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/app/AlarmManager.java b/core/java/android/app/AlarmManager.java index b4c0e314cfb6..53c79352d3f4 100644 --- a/core/java/android/app/AlarmManager.java +++ b/core/java/android/app/AlarmManager.java @@ -29,6 +29,17 @@ import android.os.ServiceManager; * if it is not already running. Registered alarms are retained while the * device is asleep (and can optionally wake the device up if they go off * during that time), but will be cleared if it is turned off and rebooted. + * + * <p>The Alarm Manager holds a CPU wake lock as long as the alarm receiver's + * onReceive() method is executing. This guarantees that the phone will not sleep + * until you have finished handling the broadcast. Once onReceive() returns, the + * Alarm Manager releases this wake lock. This means that the phone will in some + * cases sleep as soon as your onReceive() method completes. If your alarm receiver + * called {@link android.content.Context#startService Context.startService()}, it + * is possible that the phone will sleep before the requested service is launched. + * To prevent this, your BroadcastReceiver and Service will need to implement a + * separate wake lock policy to ensure that the phone continues running until the + * service becomes available. * * <p><b>Note: The Alarm Manager is intended for cases where you want to have * your application code run at a specific time, even if your application is |
