mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-15 02:57:04 +05:30
fix(android): manually set up WorkManager
This commit is contained in:
parent
7ef0a8fc51
commit
33210319bb
2 changed files with 38 additions and 0 deletions
|
@ -149,6 +149,10 @@
|
||||||
android:name="androidx.work.WorkManagerInitializer"
|
android:name="androidx.work.WorkManagerInitializer"
|
||||||
android:value="androidx.startup"
|
android:value="androidx.startup"
|
||||||
tools:node="remove" />
|
tools:node="remove" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.deliveryhero.whetstone.worker.WhetstoneWorkerInitializer"
|
||||||
|
android:value="androidx.startup"
|
||||||
|
tools:node="remove" />
|
||||||
</provider>
|
</provider>
|
||||||
<!-- https://issuetracker.google.com/issues/258619948 -->
|
<!-- https://issuetracker.google.com/issues/258619948 -->
|
||||||
<receiver
|
<receiver
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
/*
|
||||||
|
* Copyright © 2022 Harsh Shandilya.
|
||||||
|
* Use of this source code is governed by an MIT-style
|
||||||
|
* license that can be found in the LICENSE file or at
|
||||||
|
* https://opensource.org/licenses/MIT.
|
||||||
|
*/
|
||||||
|
package dev.msfjarvis.claw.android.injection
|
||||||
|
|
||||||
|
import android.app.Application
|
||||||
|
import android.util.Log
|
||||||
|
import androidx.work.Configuration
|
||||||
|
import androidx.work.WorkManager
|
||||||
|
import androidx.work.WorkerFactory
|
||||||
|
import com.deliveryhero.whetstone.app.ApplicationScope
|
||||||
|
import com.squareup.anvil.annotations.ContributesMultibinding
|
||||||
|
import dev.msfjarvis.claw.core.injection.AppPlugin
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
@ContributesMultibinding(ApplicationScope::class)
|
||||||
|
class WorkManagerPlugin
|
||||||
|
@Inject
|
||||||
|
constructor(
|
||||||
|
private val workerFactory: WorkerFactory,
|
||||||
|
) : AppPlugin {
|
||||||
|
override fun apply(application: Application) {
|
||||||
|
WorkManager.initialize(
|
||||||
|
application,
|
||||||
|
Configuration.Builder()
|
||||||
|
.setWorkerFactory(workerFactory)
|
||||||
|
.setMinimumLoggingLevel(Log.DEBUG)
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue