DownloadWorker: Move downloads observing logic into worker as well

This allows us to keep all the modifications related to DownloadWorker in a
single place.

Also, drop the 3seconds delay and do the cleanup instead of delegating it to
worker if last job was failed. This is better and more error-proof.

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2023-11-30 13:26:47 +05:30
parent 77738d8549
commit b2cbc8dc16
5 changed files with 66 additions and 63 deletions

View File

@@ -185,7 +185,7 @@ dependencies {
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
//WorkManager
implementation("androidx.work:work-runtime-ktx:2.8.1")
implementation("androidx.work:work-runtime-ktx:2.9.0-rc01")
// LeakCanary
debugImplementation("com.squareup.leakcanary:leakcanary-android:2.12")