Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content

fix:3720:service notification re-show on reboot.

Description

The foreground service notification "Starting UnifiedPush distributor" was displayed on each device restart. This bug concerned foundation.e.ntfy, but not foundation.e.advancedprivacy, which use the same logic to hide the foreground service notification.

Both apps re-create the notification channel on each startup, before making use of it (as it is a common usage in Adnroid apps). The difference is that AdvancedPrivacy call NotificationChannel::setBlockable(true) before calling NotificationManager::createNotificationChannel, while we called it just before hidding the channnel in foundation.e.ntfy.

Then, the chanel was re-created without the "blocking-allowed" flag, which makes it visible again, until the hide JOb re-hides it 30seconds later.

This MR fix this, keeping the usual behavior, but jsut setting the NotificationChannel::setBlockable(true) before any call to NotificationManager::createNotificationChannel

Tests

Reboot the device, the notification Starting UnifiedPush distributor should not shows up twice.

Issues

https://gitlab.e.foundation/e/os/backlog/-/issues/3720 https://gitlab.e.foundation/e/os/backlog/-/issues/3814

10 commandments of code review

👪 ❤️ code review guidelines

Edited by Guillaume Jacquart

Merge request reports

Loading