Package org.robolectric.shadows
Class ShadowAlarmManager
java.lang.Object
org.robolectric.shadows.ShadowAlarmManager
@Implements(android.app.AlarmManager.class) public class ShadowAlarmManager extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ShadowAlarmManager.ScheduledAlarm
Container object to hold a PendingIntent and parameters describing when to send it. -
Constructor Summary
Constructors Constructor Description ShadowAlarmManager()
-
Method Summary
Modifier and Type Method Description protected void
cancel(AlarmManager.OnAlarmListener listener)
protected void
cancel(PendingIntent operation)
protected AlarmManager.AlarmClockInfo
getNextAlarmClock()
ShadowAlarmManager.ScheduledAlarm
getNextScheduledAlarm()
List<ShadowAlarmManager.ScheduledAlarm>
getScheduledAlarms()
ShadowAlarmManager.ScheduledAlarm
peekNextScheduledAlarm()
static void
reset()
protected void
set(int type, long triggerAtTime, PendingIntent operation)
protected void
set(int type, long triggerAtTime, String tag, AlarmManager.OnAlarmListener listener, Handler targetHandler)
protected void
setAlarmClock(AlarmManager.AlarmClockInfo info, PendingIntent operation)
protected void
setAndAllowWhileIdle(int type, long triggerAtTime, PendingIntent operation)
protected void
setExact(int type, long triggerAtTime, PendingIntent operation)
protected void
setExact(int type, long triggerAtTime, String tag, AlarmManager.OnAlarmListener listener, Handler targetHandler)
protected void
setExactAndAllowWhileIdle(int type, long triggerAtTime, PendingIntent operation)
protected void
setInexactRepeating(int type, long triggerAtMillis, long intervalMillis, PendingIntent operation)
protected void
setRepeating(int type, long triggerAtTime, long interval, PendingIntent operation)
protected void
setTimeZone(String timeZone)
protected void
setWindow(int type, long windowStartMillis, long windowLengthMillis, PendingIntent operation)
protected void
setWindow(int type, long windowStartMillis, long windowLengthMillis, String tag, AlarmManager.OnAlarmListener listener, Handler targetHandler)
-
Constructor Details
-
ShadowAlarmManager
public ShadowAlarmManager()
-
-
Method Details
-
reset
-
setTimeZone
-
set
-
set
@Implementation(minSdk=24) protected void set(int type, long triggerAtTime, String tag, AlarmManager.OnAlarmListener listener, Handler targetHandler) -
setExact
@Implementation(minSdk=19) protected void setExact(int type, long triggerAtTime, PendingIntent operation) -
setExact
@Implementation(minSdk=24) protected void setExact(int type, long triggerAtTime, String tag, AlarmManager.OnAlarmListener listener, Handler targetHandler) -
setWindow
@Implementation(minSdk=19) protected void setWindow(int type, long windowStartMillis, long windowLengthMillis, PendingIntent operation) -
setWindow
@Implementation(minSdk=24) protected void setWindow(int type, long windowStartMillis, long windowLengthMillis, String tag, AlarmManager.OnAlarmListener listener, Handler targetHandler) -
setAndAllowWhileIdle
@Implementation(minSdk=23) protected void setAndAllowWhileIdle(int type, long triggerAtTime, PendingIntent operation) -
setExactAndAllowWhileIdle
@Implementation(minSdk=23) protected void setExactAndAllowWhileIdle(int type, long triggerAtTime, PendingIntent operation) -
setRepeating
@Implementation protected void setRepeating(int type, long triggerAtTime, long interval, PendingIntent operation) -
setInexactRepeating
@Implementation protected void setInexactRepeating(int type, long triggerAtMillis, long intervalMillis, PendingIntent operation) -
setAlarmClock
@Implementation(minSdk=21) protected void setAlarmClock(AlarmManager.AlarmClockInfo info, PendingIntent operation) -
getNextAlarmClock
-
getNextScheduledAlarm
- Returns:
- the next scheduled alarm after consuming it
-
peekNextScheduledAlarm
- Returns:
- the most recently scheduled alarm without consuming it
-
getScheduledAlarms
- Returns:
- all scheduled alarms
-
cancel
-
cancel
-