public class DozeTrigger extends Object
Constructor and Description |
---|
DozeTrigger(int dozeDurationMilliseconds,
Runnable onSleepRunnable) |
Modifier and Type | Method and Description |
---|---|
boolean |
isAsleep()
Returns whether the trigger has fired at least once.
|
boolean |
isDozing()
Returns whether we are dozing or not.
|
void |
poke()
Poke this dozer to wake it up if it is dozing, delaying the onSleepRunnable from being
called for a for the doze duration.
|
void |
setDozeDuration(int duration)
Updates the duration that we have to wait until dozing triggers.
|
void |
startDozing()
Starts dozing and queues the onSleepRunnable to be called.
|
void |
stopDozing()
Stops dozing and prevents the onSleepRunnable from being called.
|
public DozeTrigger(int dozeDurationMilliseconds, Runnable onSleepRunnable)
public void startDozing()
public void stopDozing()
public void setDozeDuration(int duration)
public void poke()
public boolean isDozing()
public boolean isAsleep()