Skip to content

Commit

Permalink
Increase the Work Manager version to 2.10.0 (#3632)
Browse files Browse the repository at this point in the history
  • Loading branch information
geekygecko authored Feb 25, 2025
1 parent 11e3895 commit 1b9e864
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
([#3566](https://github.com/Automattic/pocket-casts-android/pull/3566))
* Fix issue causing the Account Details page to become unresponsive after viewing an offer
([#3574](https://github.com/Automattic/pocket-casts-android/pull/3574))
* Fix crash in Android 15 with the background task manager
([#3632](https://github.com/Automattic/pocket-casts-android/pull/3632))
* Updates
* Filter out chapters that do not belong in table of contents. See [the specification](https://github.com/Podcastindex-org/podcast-namespace/blob/main/chapters/jsonChapters.md) for more details.
([#3556](https://github.com/Automattic/pocket-casts-android/pull/3556))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class UpdateEpisodeDetailsTest {
onBlocking { findByUuid(episode.uuid) }.doReturn(episode)
}

val episodeUuids = listOf(episode.uuid).toTypedArray()
val episodeUuids: Array<String?> = listOf(episode.uuid).toTypedArray()
val data = Data.Builder().putStringArray(UpdateEpisodeDetailsTask.INPUT_EPISODE_UUIDS, episodeUuids).build()
val worker = TestListenableWorkerBuilder<UpdateEpisodeDetailsTask>(context, inputData = data)
.setWorkerFactory(TestWorkerFactory(episodeManager))
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ test = "1.6.1"
tracks = "6.0.3"
wear-compose = "1.4.1"
webkit = "1.12.1"
work = "2.9.1"
work = "2.10.0"

[libraries]
# About Libraries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class DownloadManagerImpl @Inject constructor(

// FIXME this is a hack to avoid an issue where this listener says downloads
// on the watch app are enqueued when they are actually still running.
val queriedState = workManager.getWorkInfoById(workInfo.id).get().state
val queriedState = workManager.getWorkInfoById(workInfo.id).get()?.state
if (Util.isWearOs(context) && queriedState == WorkInfo.State.RUNNING) {
getRequirementsAsync(episode)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import kotlin.math.roundToInt
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.firstOrNull
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.rx2.rxCompletable
Expand Down Expand Up @@ -314,7 +315,7 @@ class PodcastSyncProcess(
emitter.onComplete()
} else {
ProcessLifecycleOwner.get().lifecycleScope.launch {
WorkManager.getInstance(context).getWorkInfoByIdFlow(workRequestId).first { it.state.isFinished }
WorkManager.getInstance(context).getWorkInfoByIdFlow(workRequestId).firstOrNull { it?.state?.isFinished ?: true }
logTime("Refresh - sync up next", startTime)
emitter.onComplete()
}
Expand Down

0 comments on commit 1b9e864

Please sign in to comment.