mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-27 03:49:04 +03:00
Javadoc
This commit is contained in:
parent
4281b5967a
commit
c19b1f917f
1 changed files with 7 additions and 2 deletions
|
@ -22,17 +22,22 @@ import androidx.work.*
|
|||
internal object WorkManagerUtil {
|
||||
private const val MATRIX_SDK_TAG = "MatrixSDK"
|
||||
|
||||
// Default constraints: network
|
||||
/**
|
||||
* Default constraints: connected network
|
||||
*/
|
||||
val workConstraints = Constraints.Builder()
|
||||
.setRequiredNetworkType(NetworkType.CONNECTED)
|
||||
.build()
|
||||
|
||||
/**
|
||||
* Create a OneTimeWorkRequestBuilder, with the Matrix SDK tag
|
||||
*/
|
||||
inline fun <reified W : ListenableWorker> matrixOneTimeWorkRequestBuilder() =
|
||||
OneTimeWorkRequestBuilder<W>()
|
||||
.addTag(MATRIX_SDK_TAG)
|
||||
|
||||
/**
|
||||
* Cancel all work instanciated by the Matrix SDK and not those from the SDK client
|
||||
* Cancel all works instantiated by the Matrix SDK and not those from the SDK client
|
||||
*/
|
||||
fun cancelAllWorks(context: Context) {
|
||||
WorkManager.getInstance(context).also {
|
||||
|
|
Loading…
Reference in a new issue