History log of /frameworks/base/core/java/android/app/AlarmManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
438693dd6cc4e3fe2ffb336d551c0d69e9546102 01-Jun-2016 Dianne Hackborn <hackbod@google.com> Merge "Work on issue #28942589: Tune job scheduler" into nyc-dev
e9a988caca733d2f292991a52a0047685a69812f 28-May-2016 Dianne Hackborn <hackbod@google.com> Work on issue #28942589: Tune job scheduler

We now have a new settings key that provides all of the existing
tuning parameters, plus some newly redone ones for dealing with
different memory levels.

Changed the minimum batching for overall jobs from 2 to 1, so
we will never get in the way of immediately scheduling jobs
when the developer asks for this. We should now be able to rely
on the doze modes to do better batching of jobs for us when it
is really important.

Also work on issue #28981330: Excessive JobScheduler wakeup alarms.
Use a work source with scheduled alarms to blame them on the app
whose job they are being scheduled for, and add a check for whether
a job's timing constraint has been satisfied before considering it
a possible candidate for the next alarm. (If it is satisified,
the time is in the past, so we should not schedule an alarm for it.)

Finally clean up a bunch of the dumpsys output to make it easier
to understand.

Change-Id: I06cf2c1310448f47cf386f393e9b267335fabaeb
/frameworks/base/core/java/android/app/AlarmManager.java
09d7d8f67433aa8ec8757647112b475947111469 01-Jun-2016 Christopher Tate <ctate@google.com> Don't bother with WeakHashMap for direct alarm bookkeeping

Call cancel() explicitly before dropping local references to your
callback objects; they won't just quietly go away.

Bug 28987260

Change-Id: Id9da66ed86a46b4fb38127e2ddd7a7d84fd2313a
/frameworks/base/core/java/android/app/AlarmManager.java
d0cca79f3c438f6db28603dc50bfa44d48461728 22-Apr-2016 Christopher Tate <ctate@google.com> Don't worry about an extra weak indirection with callback alarms

Bug 27995384

Change-Id: Ie9cf3e05dca4af7085b479fb65d4cf45ee0239ba
/frameworks/base/core/java/android/app/AlarmManager.java
33ee4bf18b51ba78f76e6f3302a21ef7550ae35c 01-Apr-2016 Joe LaPenna <jlapenna@google.com> Fix NPE in AlarmManager.cancel(...)

If AlarmManager.cancel is called before any component has had a chance
to register an alarm, sWrappers will not have been set, as it is only
initialized in setImpl.

When cancelling an alarm and sWrappers does not exist, log a warning and
return early.

BUG: 27972657
Change-Id: Ied10719ba1d154f97eecfc32f429fd9ce39bf747
/frameworks/base/core/java/android/app/AlarmManager.java
2fefbcf0d1b91f37684387971721c90112a9ac89 18-Mar-2016 Dianne Hackborn <hackbod@google.com> Fix issue #27653326: Sync doesn't work in doze maintenance

Add a (configurable) delay between when we start a maintenance
window until the minimum time we will end it.

Also switch to using the alarm manager callback API. (Yay!)

Also fix a little printing problem in the alarm manager dump
so we put the package name and not some class hash in the
summary string of an alarm entry.

Change-Id: I4281e5c80bc8b26ebc1fb6f603ec33ec0e379daa
/frameworks/base/core/java/android/app/AlarmManager.java
2affae90b862ee5e54a497767d56f4f19f47839d 10-Mar-2016 Christopher Tate <ctate@google.com> Improve AlarmManager docs

In particular, add some missing information about what
getNextAlarmClock() returns.

Bug 27562400

Change-Id: I8c76b0c4208082d4da8ea490518e023584da6440
/frameworks/base/core/java/android/app/AlarmManager.java
c53962d4ede82a03b62f0c8bb86bd0da090a15eb 02-Mar-2016 Jeff Sharkey <jsharkey@android.com> When system server goes down, crash apps more.

Apps making calls into the system server may end up persisting
internal state or making security decisions based on the perceived
success or failure of a call, or the default values returned.

The reality is that if the system process just died, init will be
along shortly to kill all running apps, so we should have no problem
rethrowing the RemoteException as a RuntimeException.

Bug: 27364859
Change-Id: Ife0bcb079636c88d54c44d17eb580409fd79028b
/frameworks/base/core/java/android/app/AlarmManager.java
bb76a6ce163cb833e195c5776d7c637b2de19427 02-Dec-2015 Christopher Tate <ctate@google.com> Relax null parameter enforcement for legacy apps

No longer throws when calling cancel() with a null PendingIntent if
the app targets SDK < NYC.

Bug 25798631

Change-Id: Ic91f42808811645b01802abcc785f4218aac0e8b
/frameworks/base/core/java/android/app/AlarmManager.java
f2d753ec466befa5238fb4f25dba88870f73cdeb 04-Nov-2015 Christopher Tate <ctate@google.com> Make WorkSource version of alarm listener API @SystemApi

WorkSource is not public API but this should be available to
system support modules.

Change-Id: I7283ab8aa5c5e298959d21a5c8fe55ed119bc6a3
/frameworks/base/core/java/android/app/AlarmManager.java
14a7bb0d370fffdf902a4e2345f46754ed2d7684 01-Oct-2015 Christopher Tate <ctate@google.com> Introduce direct listener API for alarm delivery

The Alarm Manager now supports a set() variant that takes a listener
callback to invoke at alarm trigger time rather than a PendingIntent.
This is much lower overhead and has guaranteed low delivery latency
from the trigger time. The tradeoff is that the app must be running
*continuously* from the time the alarm is set to the time it is
delivered. If the app exits for any reason before the alarm fires,
the listener becomes invalid and the alarm will be dropped. This is
more or less equivalent to setting an alarm with a broadcast
PendingIntent that matches only a runtime-registered receiver.

The app's alarm listener can be any object that implements the new
AlarmManager.OnAlarmListener interface and implements its onAlarm()
method. There is no data delivered at alarm trigger time: whatever
state needs to be associated with the specific alarm instance should
simply be packaged inside the OnAlarmListener instance.

An alarm using OnAlarmListener can request that the onAlarm() method
be called on an arbitrary handler. If the program passes 'null' for
this parameter when setting the alarm, the callback occurs on the
application's main Looper thread.

Bug 20157436

Change-Id: I2eb030a24efdd466a2eee1666c5231201b43684b
/frameworks/base/core/java/android/app/AlarmManager.java
628b4125843b93dc7f3ed0c9bbea76ff470d2eed 01-Aug-2015 Dianne Hackborn <hackbod@google.com> am bc2a8843: am b97c5ddd: am 9b36f526: am c1836bb0: Merge "Change MNC codename to just M." into mnc-dev

* commit 'bc2a88431e3dc51e2245cc28e327f11d0c78bd56':
Change MNC codename to just M.
0e3de6cacaffcfeda4d6353be61e2f1f9ed80705 30-Jul-2015 Dianne Hackborn <hackbod@google.com> Change MNC codename to just M.

Change-Id: I4281d200ff6560791c47cf9073ceea1cb509361e
/frameworks/base/core/java/android/app/AlarmManager.java
8e697eb1312bb975d7b7eee5cee71ca3c56e1d26 10-Jul-2015 Dianne Hackborn <hackbod@google.com> am 04efda69: am 6b335380: am 47306086: am a681d7d9: Merge "Improve alarm manager docs." into mnc-dev

* commit '04efda693713243a47afb193ae389d5d36ff5dfa':
Improve alarm manager docs.
14c5ab4cb90c9b10e34fabf0a6b60a68b74fd5fe 10-Jul-2015 Dianne Hackborn <hackbod@google.com> Improve alarm manager docs.

Change-Id: I7547b48327a709783d908509efc7afd1a3f1a06a
/frameworks/base/core/java/android/app/AlarmManager.java
2712ce948a9ab6f0ddb7945432f2807933c8b397 12-Jun-2015 Dianne Hackborn <hackbod@google.com> am 6e2fb78f: am e554cc96: Merge "Implement some control over ALLOW_WHILE_IDLE alarms." into mnc-dev

* commit '6e2fb78fbe3ce50182f0ad928748aeada57a44cf':
Implement some control over ALLOW_WHILE_IDLE alarms.
3d1933c45fe9ba2389ebd166d96abeceab1971d1 11-Jun-2015 Dianne Hackborn <hackbod@google.com> Implement some control over ALLOW_WHILE_IDLE alarms.

Since these alarms allow you to bypass the idle restrictions,
we don't want them to be so open-ended like other alarms. This
implements a policy where the alarm manager will only deliver these
types of alarms every X minutes to each application. For this
initial implementation, X is 1 minute under normal operation and
15 minutes when in idle mode.

To do this, I needed to introduce a new internal allow-while-idle
flag for system alarms, which applications can't get, and doesn't
have these new restrictions.

Also tweaked how the alarm manager handles the alarm window, so it
doesn't change if the alarm gets rescheduld; the window is now always
what as computed based on the time when the alarm was first
given to it.

Finally, fix TimeUtils to be able to correctly print times that
are > 999 days.

Change-Id: Ibad8c6a7c14b0624b54e82267be23224b4c31e84
/frameworks/base/core/java/android/app/AlarmManager.java
0ae8fa750212c518e069461f6e885cccfe33ee18 14-May-2015 Chris Tate <ctate@android.com> am 7b566da5: Merge "AlarmClockInfo: fix redundant word in doc comment"

* commit '7b566da55afad480622c328d658f0e654019688d':
AlarmClockInfo: fix redundant word in doc comment
66729ff685e6a47c63e8137d26ec22525cd8f385 13-May-2015 Shuhrat Dehkanov <k@efir.uz> AlarmClockInfo: fix redundant word in doc comment

Removed one of unintentional double "intent"s.

Change-Id: I0ce4224964afae0587ce55b6b4775370eff89d26
Signed-off-by: Shuhrat Dehkanov <k@efir.uz>
/frameworks/base/core/java/android/app/AlarmManager.java
8d66b3fbf5d8036e25d64a8472bcd2b6b7892a1a 09-May-2015 Dianne Hackborn <hackbod@google.com> Implement device idle in power manager.

When in device idle mode, we now prevent most apps
from being able to hold partial wake locks. The
device idle controller now pushes its white list of
app uids into the power manager, so it can apply this
policy correctly to only apps that are not whitelisted.

The implementation adds a new "disabled" flag to a wake
lock which is set when we want to apply this policy. When
set, we ensure that we tell battery stats that the wake lock
is not being held and ignore that wake lock when computing
the power state summary.

Also add new SDK APIs to schedule alarms that are allowed
to execute while in idle mode.

Finally add new dumpsys commands to the device idle controller
to completely disable and re-enable its operation, to use
for testing.

Change-Id: I1f16672c6ac06d03bb538f9854d5843db9aa6f27
/frameworks/base/core/java/android/app/AlarmManager.java
a78240ba5f891c3fd0acb62a1b13b6dc1bbe9705 24-Apr-2015 Narayan Kamath <narayan@google.com> AlarmManager: Reject non-olson timezones for targetSdk >= M

This has caused a lot of grief, confusion and outright broken
behaviour due to the fact that the Posix spec and the Java spec
define conflicting interpretations of "custom" timezones like
GMT+5:30 (eastern hemisphere for java, western for posix).

bug: 19987403
bug: 19106773
Change-Id: Ia9b007067bb175b0805d4262f17390a0bd98d927
/frameworks/base/core/java/android/app/AlarmManager.java
f70faed503c8482266e6acb94dd5281488a9117e 21-Apr-2015 Dianne Hackborn <hackbod@google.com> Work on issue #20401752: device idle and alarms.

Main change is to fix problems in the alarm manager where it
was not doing a good job at scheduling the device idle wakeup
before an alarm. To fix this, we now keep explicit track of
the next "wake from idle" alarm so we can consistently use that
to adjust the time of the device idle alarm if needed.

Also a bunch of debugging stuff to help further diagnose this
problem:

- Alarm summary now includes the last time the alarm went off.
- Improved dumpsys output of alarms.
- New event log tags for changes related to idle state.

Change-Id: Idd2c8d24ae23379f7c75815ddbc6835c2a04656c
/frameworks/base/core/java/android/app/AlarmManager.java
4870e9d5eba59fb257a87f97f1adf0b734cf48d3 09-Apr-2015 Dianne Hackborn <hackbod@google.com> More work on device idle mode and other power stuff.

Add idle mode support to the alarm manager. Introduce
a new concept of flags associated with alarms to tell
the alarm manager how to treat the alarm -- they allow
everything from the alarm that will bring us out of idle
mode, to alarms that are allowed when idle or should
also bring us out of idle. The standalone boolean is
now also a flag.

(Note there is currently no protection from user space
setting the flags however it wants; I will be working
on that in a follow-up change.)

When in idle mode, the alarm manager pushes all alarms
that shouldn't execute during that time over to a
separate list that is not executed until out of idle.
To help with this, I reworked a bit how Alarm objects
are managed, so that when rebatching or moving between
lists we don't have to allocated new objects but can
just use the same existing instance.

Also tweaked the sync manager to deal with idle mode,
which currently just means doing the same thing as when
low on storage -- turning off sync.

Add new ACTION_CHARGING and ACTION_DISCHARGING broadcasts
that apps can listen for to know when the device is actively
charging and discharging. These are better than the old
POWER_CONNECTED and POWER_DISCONNECTED ones because we only
report charging when we actually see that there is enough
power being provided to charge the battery (and will report
discharging if there is not enough power).

The job controller uses these new actions for scheduling
jobs that want to run while plugged in. Removed the
"stable charging" stuff while doing so, since the new
charging state serves as an even better signal for that.

Introduced two new process states: FOREGROUND_SERVICE and
TOP_SLEEPING. This will allow us to treat foreground services
specially (such as still allowing network access to them for
background music playback) while not mixing them together with
whatever happens to be the top activity while the device is
asleep.

Also some other small cleanup here and there.

Change-Id: I7a9808b578bad6f50deb8e1baf919298512a0d3a
/frameworks/base/core/java/android/app/AlarmManager.java
08c7116ab9cd04ad6dd3c04aa1017237e7f409ac 28-Feb-2015 John Spurlock <jspurlock@google.com> Remove unused imports in frameworks/base.

Change-Id: I031443de83f93eb57a98863001826671b18f3b17
/frameworks/base/core/java/android/app/AlarmManager.java
c20b795cf05b48fe5e024c19dab9c7e4b18cd10f 04-Sep-2014 David Christie <dnchrist@google.com> Add @SystemApi annotations to methods used by GmsCore.
-Currently these methods are called using reflection for location.
Bug: 17371392
Change-Id: I6546f5b485415beff69164ba0d526757ee831f69
/frameworks/base/core/java/android/app/AlarmManager.java
235510e67210f90de30c2d5582a2077ccc589619 13-Aug-2014 Jose Lima <joselima@google.com> Made AlarmClockInfo a nested class in AlarmManager

Bug: 16959028
Change-Id: I150eaaff765d1e214c3621c1bf50162ec0dac8ec
/frameworks/base/core/java/android/app/AlarmManager.java
c42a1e1071937ae48b7aa5d6291a32c29078b74b 07-Jul-2014 Adrian Roos <roosa@google.com> Add AlarmClock API to AlarmManager

Adds a new kind of alarm that represents an alarm clock and
a way to query the next scheduled alarm clock.

Deprecates Settings.System.NEXT_ALARM_FORMATTED.

Bug: 14589952
Change-Id: I297eeeff36d07adcda010afac183d0f5ee37dc99
/frameworks/base/core/java/android/app/AlarmManager.java
109e4db47187adc484dbbf23ceaaa4295c6df105 26-Oct-2013 Christopher Tate <ctate@google.com> Un-deprecate setInexactRepeating() and tweak docs

Bug 10461371

Change-Id: Ic62a0e94c83c0c7b50e21a7bee19c3d92255d231
/frameworks/base/core/java/android/app/AlarmManager.java
062bce7d87e34f85dc0972c03c59f37d6df15c39 25-Oct-2013 Christopher Tate <ctate@google.com> DOCS: document API 19+ Alarm Manager API and behaviors

Bug 9941334

Change-Id: I65473bd62f7113c74ed6277d61db56c76441ff1b
/frameworks/base/core/java/android/app/AlarmManager.java
e8222dddaf2e3da14380101e818d4254899e0c0d 05-Sep-2013 Chet Haase <chet@google.com> Change build version from KEY_LIME_PIE to KITKAT

Issue #10631619 Change build version to KitKat

Change-Id: I6ad13f6169ad74204078d36929479998b498ad8b
/frameworks/base/core/java/android/app/AlarmManager.java
ebe51fc0d860077245c44bfb00130be62da001e1 26-Jul-2013 David Christie <dnchrist@google.com> Add WorkSource capability to AlarmManager.

Change-Id: I663ea3078d405f0fa667a04bdaa376ae6652e994
/frameworks/base/core/java/android/app/AlarmManager.java
56cfa244128402ca288be5726cc0eb9b2d668295 31-Jul-2013 Christopher Tate <ctate@google.com> Temporary stay of execution

Change-Id: I5d3b4213233f6326a8f7ee4891f1f71539649b8d
/frameworks/base/core/java/android/app/AlarmManager.java
5f221e8f93fff70f8a2e192976aac587b8c9c026 31-Jul-2013 Christopher Tate <ctate@google.com> If you set an alarm before the epoch, you're gonna have a bad time

For apps build against the KLP+ SDK, this will now throw an illegal argument
exception. Legacy apps will simply see the alarm delivered immediately.

Bug 9965704

Change-Id: Ia103d9529d32640098be324820fe228efa95431d
/frameworks/base/core/java/android/app/AlarmManager.java
f10f9ea06c9de12db18896643d30bef7d8a89cb5 26-Jul-2013 David Christie <dnchrist@google.com> Revert "Add WorkSource capability to AlarmManager"

This reverts commit 02600fb66b805c161e35f6c787372e4074f2213f.

Broke some tests.

Change-Id: Ic47b23a935bf90aba817073c27cd247306db7d5f
/frameworks/base/core/java/android/app/AlarmManager.java
02600fb66b805c161e35f6c787372e4074f2213f 25-Jul-2013 David Christie <dnchrist@google.com> Add WorkSource capability to AlarmManager

Change-Id: Ibcff01a9f54a89fde6e7e5b7658e9a90b9a2445b
/frameworks/base/core/java/android/app/AlarmManager.java
57ceaaa0aa1fece02ff82cd903a26bdf65131c56 20-Jul-2013 Christopher Tate <ctate@google.com> Add AlarmManager.setWindow(...) for supplying an explicit delivery window

Bug 9532215

Change-Id: I0efe32cbaaae8ce6ab223041eed116c3470a7326
/frameworks/base/core/java/android/app/AlarmManager.java
e0a22b324d0e3157e570ea5f71cc682fa9696e01 11-Jul-2013 Christopher Tate <ctate@google.com> Batch alarms to reduce device wakeups

The default Alarm Manager behavior for KLP+ apps will be to aggressively
coalesce alarms, trading exact timeliness of delivery for minimizing the
number of alarm-delivery points, especially wakeup points.

There is new API in AlarmManager, setExact() and setExactRepeating(),
for use by apps that absolutely *must* get their alarms at a specific
point in time.

Bug 9532215

Change-Id: I40b4eea90220211cc958172d2629664b921ff051
/frameworks/base/core/java/android/app/AlarmManager.java
79074cd935854b497cb894046da13bb08a113982 23-Dec-2011 Jesse Wilson <jessewilson@google.com> Explicitly specify 'milliseconds' as alarm manager's time unit.

Change-Id: Ic247c1a17283f7b1aa51cae8a2b43e987208aa8a
/frameworks/base/core/java/android/app/AlarmManager.java
97e44947282b3918ee0bed2d16b33b983f882580 05-Feb-2010 Dan Egnor <egnor@google.com> Add an AlarmManager API to set the system time (with the proper permissions).
/frameworks/base/core/java/android/app/AlarmManager.java
a34df8a2ba450b2c2ad83ccbbac30b80e2706bb2 03-Apr-2009 Chris Tate <> 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
/frameworks/base/core/java/android/app/AlarmManager.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/app/AlarmManager.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/app/AlarmManager.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/core/java/android/app/AlarmManager.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/android/app/AlarmManager.java