Updated WorkManager (#3483)
* Updated WorkManager Updated the WorkManager library to latest version and also updated the code for its initialization. * Updated WorkManager Updated the WorkManager library to latest version and also updated the code for its initialization.
This commit is contained in:
@@ -130,7 +130,6 @@ dependencies {
|
||||
implementation(libs.language.json)
|
||||
implementation(libs.quickie.bundled)
|
||||
implementation(libs.core)
|
||||
// Updating these 2 dependencies may cause some errors. Be careful.
|
||||
implementation(libs.work.runtime.ktx)
|
||||
implementation(libs.work.multiprocess)
|
||||
}
|
||||
@@ -3,21 +3,30 @@ package com.v2ray.ang
|
||||
import android.content.Context
|
||||
import androidx.multidex.MultiDexApplication
|
||||
import androidx.work.Configuration
|
||||
import androidx.work.WorkManager
|
||||
import com.tencent.mmkv.MMKV
|
||||
import com.v2ray.ang.util.Utils
|
||||
|
||||
class AngApplication : MultiDexApplication(), Configuration.Provider {
|
||||
companion object {
|
||||
class AngApplication : MultiDexApplication()
|
||||
{
|
||||
companion object
|
||||
{
|
||||
//const val PREF_LAST_VERSION = "pref_last_version"
|
||||
lateinit var application: AngApplication
|
||||
}
|
||||
|
||||
override fun attachBaseContext(base: Context?) {
|
||||
override fun attachBaseContext(base: Context?)
|
||||
{
|
||||
super.attachBaseContext(base)
|
||||
application = this
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
private val workManagerConfiguration: Configuration = Configuration.Builder()
|
||||
.setDefaultProcessName("${BuildConfig.APPLICATION_ID}:bg")
|
||||
.build()
|
||||
|
||||
override fun onCreate()
|
||||
{
|
||||
super.onCreate()
|
||||
|
||||
// LeakCanary.install(this)
|
||||
@@ -31,11 +40,7 @@ class AngApplication : MultiDexApplication(), Configuration.Provider {
|
||||
MMKV.initialize(this)
|
||||
|
||||
Utils.setNightMode(application)
|
||||
}
|
||||
|
||||
override fun getWorkManagerConfiguration(): Configuration {
|
||||
return Configuration.Builder()
|
||||
.setDefaultProcessName("${BuildConfig.APPLICATION_ID}:bg")
|
||||
.build()
|
||||
// Initialize WorkManager with the custom configuration
|
||||
WorkManager.initialize(this, workManagerConfiguration)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ rxjava = "3.1.8"
|
||||
rxpermissions = "0.12"
|
||||
toastcompat = "1.1.0"
|
||||
viewpager2 = "1.1.0"
|
||||
workRuntimeKtx = "2.8.1"
|
||||
workRuntimeKtx = "2.9.1"
|
||||
|
||||
[libraries]
|
||||
activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "activityKtx" }
|
||||
|
||||
Reference in New Issue
Block a user