API DocumentationDocumentation for developing SailfishOS applications
BackgroundJob QML Type
Provides means for waking up from / preventing suspend More...
|Import Statement:||import Nemo.Keepalive 1.2|
- enabled : bool
- frequency : enumeration
- maximumWait : int
- minimumWait : int
- running : bool
- triggeredOnEnable : bool
Provides abstraction for scheduling tasks that can wake the system from suspended state and prevent system from suspending while handling the wakeup.
If changed from false to true, starts the timer.
If changed from true to false, stops the timer / ends suspend prevention.
enabled defaults to false.
Sets the desired wakeup frequency and starts the timer.
Note that wakeups are aligned in system wide manner so that every timer that is scheduled to occur in the same frequency gets triggered simultaneously. Effectively this means that the first wakeup most likely happens earlier then the requested frequency would suggest.
The frequence can be one of:
- BackgroundJob.OneHour - the default
Note that defining wakeup frequency is mutually exclusive with using wakeup range.
Returns true when the timer has been triggered (and the device is prevented from suspending).
This property serves similar purpose as triggeredOnStart in standard QML Timer objects: Setting triggeredOnEnable to true causes triggering immediately after enabling - which can be useful for example for establishing an initial state.
triggeredOnEnable defaults to false.
This signal is emitted when timer wakeup occurs and system is prevented from suspending.
In order to allow suspending again, the application must define onTriggered handler and make sure one of the following actions are taken after handling tasks related to the wakeup: