* Simplify DownloadService wake lock handling
_isRunning is only modified in onCreate/onDestroy, so the listener
job is redundant.
* Drop superclass calls to Service.onCreate/onDestroy
From https://developer.android.com/guide/components/services
> Note: Unlike the activity lifecycle callback methods, you are not
> required to call the superclass implementation of these callback
> methods.
Fixes#8962.
withTimeout throws a TimeoutCancellationException if the timeout
expires. To avoid crashing renewalJob when there are no extensions,
use withTimeoutOrNull which does not throw on timeout.
Fixup for e4bc8990 (#8955)
HttpSource.fetchImage() uses Call.asObservableSuccess(), which
cancels the call on unsubscribe. This causes the call to be cancelled
before it is used, leading to a "java.net.SocketException: Socket is
closed" when trying to use the response in putImageToCache().
To fix this, use Call.awaitSuccess() via a new HttpSource.getImage()
suspending function. This addition to source-api is only intended for
app use, so it will not be added to the extensions-api stubs.
To keep the commit from being 100+ files the interactors wasn't moved.
The domain module like the data module uses `tachiyomi` instead of `eu.kanade.tachiyomi` for package names
Fixes#8881
The actual issue is that the ViewModel migration actually differs between what the current `init` block
and previous `onSave` methods did; where the `init` block does not get triggered on saving the
instance on config changes.
Not entirely sure why onSaveInstanceState was explicitly avoided for config changes before, but we
just do it all the time now and end up updating the requestedPage with the current page.
* Convert downloader Observable to flow
Uses `runInterruptible` to turn the blocking call to `queue.take()`
into a cancellable call.
Flow collection is ended by cancelling the scope in `recycle`. This
means the `HttpPageLoader` can't be reused after calling `recycle`,
but this was true with the `Observable` as well.)
* Convert load Observables to suspending function
Inlining the Observables allows for some simplification of the error
handling. Behavior should be otherwise identical.
* Convert cleanup Completable to coroutine
Uses global `launchIO`, not ideal but similar to previous behavior.
Can't be scheduled on the local `scope` as this runs after `scope` is
cancelled.