Explicitly mark service notifications as ongoing

This commit is contained in:
M66B 2022-04-24 19:03:29 +02:00
parent a4265be2d4
commit d0a9e49221
3 changed files with 5 additions and 2 deletions

View File

@ -137,7 +137,8 @@ public class ServiceExternal extends Service {
.setPriority(NotificationCompat.PRIORITY_MIN)
.setCategory(NotificationCompat.CATEGORY_SERVICE)
.setVisibility(NotificationCompat.VISIBILITY_SECRET)
.setLocalOnly(true);
.setLocalOnly(true)
.setOngoing(true);
return builder;
}

View File

@ -222,6 +222,7 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
.setOnlyAlertOnce(!alert)
.setDefaults(0) // disable sound on pre Android 8
.setLocalOnly(true)
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_MIN)
.setCategory(NotificationCompat.CATEGORY_SERVICE)
.setVisibility(NotificationCompat.VISIBILITY_SECRET);

View File

@ -1314,7 +1314,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
.setDefaults(0) // disable sound on pre Android 8
.setCategory(NotificationCompat.CATEGORY_SERVICE)
.setVisibility(NotificationCompat.VISIBILITY_SECRET)
.setLocalOnly(true);
.setLocalOnly(true)
.setOngoing(true);
if (lastAccounts > 0)
builder.setContentTitle(getResources().getQuantityString(