diff options
author | Suprabh Shukla <suprabh@google.com> | 2021-06-29 16:18:31 -0700 |
---|---|---|
committer | Suprabh Shukla <suprabh@google.com> | 2021-06-29 17:34:14 -0700 |
commit | 94f5840bed5f853713ceaeea184f0e4b13682293 (patch) | |
tree | 5faf626eca49a4b5340e8d6ccc5af7306ed4fec7 /apex | |
parent | ff50eb43a359f367a19c3c0e53f581c08eeb8811 (diff) |
Improve javadocs for repeating alarms
Specifically, mentioning that the alarm count can only be included with
the alarm if the supplied pending intent is mutable.
Test: make offline-sdk-docs
Fixes: 178413211
Change-Id: I2914bceebeed8b52b0de11d70960aa33e6837b13
Diffstat (limited to 'apex')
-rw-r--r-- | apex/jobscheduler/framework/java/android/app/AlarmManager.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apex/jobscheduler/framework/java/android/app/AlarmManager.java b/apex/jobscheduler/framework/java/android/app/AlarmManager.java index 4843415fdbdd..f1ac3da52d21 100644 --- a/apex/jobscheduler/framework/java/android/app/AlarmManager.java +++ b/apex/jobscheduler/framework/java/android/app/AlarmManager.java @@ -494,6 +494,9 @@ public class AlarmManager { * exact alarms, rescheduling each time as described above. Legacy applications * whose {@code targetSdkVersion} is earlier than API 19 will continue to have all * of their alarms, including repeating alarms, treated as exact. + * <p>Apps targeting {@link Build.VERSION_CODES#S} will need to set the flag + * {@link PendingIntent#FLAG_MUTABLE} on the {@link PendingIntent} being used to set this alarm, + * if they want the alarm count to be supplied with the key {@link Intent#EXTRA_ALARM_COUNT}. * * @param type type of alarm. * @param triggerAtMillis time in milliseconds that the alarm should first @@ -516,6 +519,7 @@ public class AlarmManager { * @see #ELAPSED_REALTIME_WAKEUP * @see #RTC * @see #RTC_WAKEUP + * @see Intent#EXTRA_ALARM_COUNT */ public void setRepeating(@AlarmType int type, long triggerAtMillis, long intervalMillis, PendingIntent operation) { @@ -1004,6 +1008,9 @@ public class AlarmManager { * been available since API 3, your application can safely call it and be * assured that it will get similar behavior on both current and older versions * of Android. + * <p>Apps targeting {@link Build.VERSION_CODES#S} will need to set the flag + * {@link PendingIntent#FLAG_MUTABLE} on the {@link PendingIntent} being used to set this alarm, + * if they want the alarm count to be supplied with the key {@link Intent#EXTRA_ALARM_COUNT}. * * @param type type of alarm. * @param triggerAtMillis time in milliseconds that the alarm should first @@ -1038,6 +1045,7 @@ public class AlarmManager { * @see #INTERVAL_HOUR * @see #INTERVAL_HALF_DAY * @see #INTERVAL_DAY + * @see Intent#EXTRA_ALARM_COUNT */ public void setInexactRepeating(@AlarmType int type, long triggerAtMillis, long intervalMillis, PendingIntent operation) { |