From 7448fd24161aff22438a487adf3dbc927fed82df Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Thu, 29 Feb 2024 12:21:15 +0100 Subject: [PATCH] change SendStatusService type to shortService (#4292) This way the `FOREGROUND_SERVICE_REMOTE_MESSAGING` permission is not needed and we should be able to publish on Google Play again. Drawback: The service can get killed after a while (usually 3 mins) on Android 14. I also tried using [user initiated data transfer jobs](https://developer.android.com/about/versions/14/changes/user-initiated-data-transfers), but that is not available on all api levels, and `WorkManager`, but that is a huge refactoring and sending would probably work differently than before. --- app/src/main/AndroidManifest.xml | 3 +-- .../tusky/service/SendStatusService.kt | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 739f96201..54fbf8d23 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -8,7 +8,6 @@ - + serviceScope.launch { + failSending(statusId) + } + } + } + private fun sendStatus(statusId: Int) { // when statusToSend == null, sending has been canceled val statusToSend = statusesToSend[statusId] ?: return