Improve FetchPushForegroundService's reliability (#6757)

* Improve `FetchPushForegroundService`'s reliability

- Don't use DI, we can just create the notification channel. This should speed up the creation of the service and reduce the number of `ForegroundServiceDidNotStartInTimeException` received. Also use `MainScope` instead of the app's coroutine scope.
- Move the wakelock releasing mechanism to `onDestroy` so it's always used. Previously, this would only happen when `stopService` was called, which would only happen when `stopSelf()` is called, but not when the OS or the service manager stops the service.

* Add fallback value for the notification channel title

* Replace the wrong string for the notification/channel title

---------

Co-authored-by: Benoit Marty <benoitm@element.io>
This commit is contained in:
Jorge Martin Espinosa 2026-05-12 11:40:46 +02:00 committed by GitHub
parent 4975f61eb8
commit 108498777b
22 changed files with 60 additions and 62 deletions

View file

@ -198,7 +198,6 @@
<string name="common_advanced_settings">"Paramètres avancés"</string>
<string name="common_an_image">"une image"</string>
<string name="common_analytics">"Statistiques dutilisation"</string>
<string name="common_android_fetching_notifications_title">"Synchronisation des notifications…"</string>
<string name="common_android_shortcuts_remove_reason_left_room">"Vous avez quitté le salon"</string>
<string name="common_android_shortcuts_remove_reason_session_logged_out">"Vous avez été déconnecté de la session"</string>
<string name="common_appearance">"Apparence"</string>
@ -244,6 +243,7 @@ Raison : %1$s."</string>
<string name="common_failed">"Échec"</string>
<string name="common_favourite">"Favori"</string>
<string name="common_favourited">"Ajouté aux favoris"</string>
<string name="common_fetching_notifications_title_android">"Synchronisation des notifications…"</string>
<string name="common_file">"Fichier"</string>
<string name="common_file_deleted">"Fichier supprimé"</string>
<string name="common_file_saved">"Fichier enregistré"</string>