parent
bff98ca768
commit
ab6dfe9e25
7 changed files with 22 additions and 22 deletions
|
@ -61,9 +61,9 @@ class DelayedTrackingUpdateJob(context: Context, workerParams: WorkerParameters)
|
||||||
private const val TAG = "DelayedTrackingUpdate"
|
private const val TAG = "DelayedTrackingUpdate"
|
||||||
|
|
||||||
fun setupTask(context: Context) {
|
fun setupTask(context: Context) {
|
||||||
val constraints = Constraints.Builder()
|
val constraints = Constraints(
|
||||||
.setRequiredNetworkType(NetworkType.CONNECTED)
|
requiredNetworkType = NetworkType.CONNECTED,
|
||||||
.build()
|
)
|
||||||
|
|
||||||
val request = OneTimeWorkRequestBuilder<DelayedTrackingUpdateJob>()
|
val request = OneTimeWorkRequestBuilder<DelayedTrackingUpdateJob>()
|
||||||
.setConstraints(constraints)
|
.setConstraints(constraints)
|
||||||
|
|
|
@ -550,11 +550,11 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
|
||||||
val interval = prefInterval ?: preferences.libraryUpdateInterval().get()
|
val interval = prefInterval ?: preferences.libraryUpdateInterval().get()
|
||||||
if (interval > 0) {
|
if (interval > 0) {
|
||||||
val restrictions = preferences.libraryUpdateDeviceRestriction().get()
|
val restrictions = preferences.libraryUpdateDeviceRestriction().get()
|
||||||
val constraints = Constraints.Builder()
|
val constraints = Constraints(
|
||||||
.setRequiredNetworkType(if (DEVICE_NETWORK_NOT_METERED in restrictions) { NetworkType.UNMETERED } else { NetworkType.CONNECTED })
|
requiredNetworkType = if (DEVICE_NETWORK_NOT_METERED in restrictions) { NetworkType.UNMETERED } else { NetworkType.CONNECTED },
|
||||||
.setRequiresCharging(DEVICE_CHARGING in restrictions)
|
requiresCharging = DEVICE_CHARGING in restrictions,
|
||||||
.setRequiresBatteryNotLow(DEVICE_BATTERY_NOT_LOW in restrictions)
|
requiresBatteryNotLow = DEVICE_BATTERY_NOT_LOW in restrictions,
|
||||||
.build()
|
)
|
||||||
|
|
||||||
val request = PeriodicWorkRequestBuilder<LibraryUpdateJob>(
|
val request = PeriodicWorkRequestBuilder<LibraryUpdateJob>(
|
||||||
interval.toLong(),
|
interval.toLong(),
|
||||||
|
|
|
@ -37,9 +37,9 @@ class AppUpdateJob(private val context: Context, workerParams: WorkerParameters)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val constraints = Constraints.Builder()
|
val constraints = Constraints(
|
||||||
.setRequiredNetworkType(NetworkType.CONNECTED)
|
requiredNetworkType = NetworkType.CONNECTED,
|
||||||
.build()
|
)
|
||||||
|
|
||||||
val request = PeriodicWorkRequestBuilder<AppUpdateJob>(
|
val request = PeriodicWorkRequestBuilder<AppUpdateJob>(
|
||||||
7,
|
7,
|
||||||
|
|
|
@ -71,9 +71,9 @@ class ExtensionUpdateJob(private val context: Context, workerParams: WorkerParam
|
||||||
val preferences = Injekt.get<BasePreferences>()
|
val preferences = Injekt.get<BasePreferences>()
|
||||||
val autoUpdateJob = forceAutoUpdateJob ?: preferences.automaticExtUpdates().get()
|
val autoUpdateJob = forceAutoUpdateJob ?: preferences.automaticExtUpdates().get()
|
||||||
if (autoUpdateJob) {
|
if (autoUpdateJob) {
|
||||||
val constraints = Constraints.Builder()
|
val constraints = Constraints(
|
||||||
.setRequiredNetworkType(NetworkType.CONNECTED)
|
requiredNetworkType = NetworkType.CONNECTED,
|
||||||
.build()
|
)
|
||||||
|
|
||||||
val request = PeriodicWorkRequestBuilder<ExtensionUpdateJob>(
|
val request = PeriodicWorkRequestBuilder<ExtensionUpdateJob>(
|
||||||
2,
|
2,
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
[versions]
|
[versions]
|
||||||
agp_version = "7.4.1"
|
agp_version = "7.4.1"
|
||||||
lifecycle_version = "2.5.1"
|
lifecycle_version = "2.6.0-beta01"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
gradle = { module = "com.android.tools.build:gradle", version.ref = "agp_version" }
|
gradle = { module = "com.android.tools.build:gradle", version.ref = "agp_version" }
|
||||||
|
|
||||||
annotation = "androidx.annotation:annotation:1.5.0"
|
annotation = "androidx.annotation:annotation:1.5.0"
|
||||||
appcompat = "androidx.appcompat:appcompat:1.6.0"
|
appcompat = "androidx.appcompat:appcompat:1.6.1"
|
||||||
biometricktx = "androidx.biometric:biometric-ktx:1.2.0-alpha05"
|
biometricktx = "androidx.biometric:biometric-ktx:1.2.0-alpha05"
|
||||||
constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.4"
|
constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.4"
|
||||||
coordinatorlayout = "androidx.coordinatorlayout:coordinatorlayout:1.2.0"
|
coordinatorlayout = "androidx.coordinatorlayout:coordinatorlayout:1.2.0"
|
||||||
|
@ -21,11 +21,11 @@ lifecycle-common = { module = "androidx.lifecycle:lifecycle-common", version.ref
|
||||||
lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "lifecycle_version" }
|
lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "lifecycle_version" }
|
||||||
lifecycle-runtimektx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle_version" }
|
lifecycle-runtimektx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle_version" }
|
||||||
|
|
||||||
work-runtime = "androidx.work:work-runtime-ktx:2.8.0-rc01"
|
work-runtime = "androidx.work:work-runtime-ktx:2.8.0"
|
||||||
guava = "com.google.guava:guava:31.1-android"
|
guava = "com.google.guava:guava:31.1-android"
|
||||||
|
|
||||||
paging-runtime = "androidx.paging:paging-runtime:3.1.1"
|
paging-runtime = "androidx.paging:paging-runtime:3.1.1"
|
||||||
paging-compose = "androidx.paging:paging-compose:1.0.0-alpha17"
|
paging-compose = "androidx.paging:paging-compose:1.0.0-alpha18"
|
||||||
|
|
||||||
benchmark-macro = "androidx.benchmark:benchmark-macro-junit4:1.1.1"
|
benchmark-macro = "androidx.benchmark:benchmark-macro-junit4:1.1.1"
|
||||||
test-ext = "androidx.test.ext:junit-ktx:1.1.5"
|
test-ext = "androidx.test.ext:junit-ktx:1.1.5"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[versions]
|
[versions]
|
||||||
compiler = "1.4.0"
|
compiler = "1.4.2"
|
||||||
compose-bom = "2023.01.00"
|
compose-bom = "2023.01.00"
|
||||||
accompanist = "0.28.0"
|
accompanist = "0.28.0"
|
||||||
|
|
||||||
|
@ -16,9 +16,9 @@ material3-core = { module = "androidx.compose.material3:material3" }
|
||||||
material-icons = { module = "androidx.compose.material:material-icons-extended" }
|
material-icons = { module = "androidx.compose.material:material-icons-extended" }
|
||||||
|
|
||||||
# Here until M3's swipeable became public https://issuetracker.google.com/issues/234640556
|
# Here until M3's swipeable became public https://issuetracker.google.com/issues/234640556
|
||||||
# Using alpha version for PullRefresh fix
|
# Using newer version for PullRefresh fix
|
||||||
# TODO: use default version after next Compose BOM is released
|
# TODO: use default version after next Compose BOM is released
|
||||||
material-core = { module = "androidx.compose.material:material", version = "1.4.0-alpha05" }
|
material-core = { module = "androidx.compose.material:material", version = "1.4.0-beta01" }
|
||||||
|
|
||||||
accompanist-webview = { module = "com.google.accompanist:accompanist-webview", version.ref = "accompanist" }
|
accompanist-webview = { module = "com.google.accompanist:accompanist-webview", version.ref = "accompanist" }
|
||||||
accompanist-flowlayout = { module = "com.google.accompanist:accompanist-flowlayout", version.ref = "accompanist" }
|
accompanist-flowlayout = { module = "com.google.accompanist:accompanist-flowlayout", version.ref = "accompanist" }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[versions]
|
[versions]
|
||||||
kotlin_version = "1.8.0"
|
kotlin_version = "1.8.10"
|
||||||
serialization_version = "1.4.0"
|
serialization_version = "1.4.0"
|
||||||
xml_serialization_version = "0.84.3"
|
xml_serialization_version = "0.84.3"
|
||||||
|
|
||||||
|
|
Reference in a new issue