yokai/app
Ahmad Ansori Palembani 97bd9c4bc8
fix(worker): Add delay to tryToSetForeground function
> The system will crash the app if the worker that calls setForeground() finished
> before the service runner be able to call Service.startForeground(). This edge
> case is not handled by WorkManager and there is no way to check if the required
> calls are done.

The delay duration is a magic number where we assume by then the
transition to foreground service is done.

Seems to be an issue introduced in Android 8, and Google refuses to fix
it, as usual.

REF: https://developer.android.com/about/versions/oreo/background.html#services (Last paragraph of the section)
REF: https://issuetracker.google.com/issues/76112072#comment36 (Status is set to Won't Fix)

Co-authored-by: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com>
2024-08-06 07:08:03 +07:00
..
src fix(worker): Add delay to tryToSetForeground function 2024-08-06 07:08:03 +07:00
.gitignore
build.gradle.kts refactor: Simplify beta version format 2024-08-02 07:05:40 +07:00
proguard-android-optimize.txt
proguard-rules.pro refactor: Use libarchive for Archive support 2024-06-27 10:03:41 +07:00