public interface Scheduler
Requirements are met.| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel()
Cancels anything that was previously scheduled, or else does nothing.
|
boolean |
schedule(Requirements requirements,
java.lang.String servicePackage,
java.lang.String serviceAction)
Schedules a service to be started in the foreground when some
Requirements are met. |
static final boolean DEBUG
boolean schedule(Requirements requirements, java.lang.String servicePackage, java.lang.String serviceAction)
Requirements are met.
Anything that was previously scheduled will be canceled.
The service to be started must be declared in the manifest of servicePackage with an
intent filter containing serviceAction. Note that when started with serviceAction, the service must call Service.startForeground(int, Notification) to
make itself a foreground service, as documented by ContextWrapper.startForegroundService(Intent).
requirements - The requirements.servicePackage - The package name.serviceAction - The action with which the service will be started.boolean cancel()