fix:3399: make trackerService a foregound service to avoid freezing.
Description
Removing persistent flag broke DNS resolution on eOS devices in certain conditions :
- on A14 and A15
- on device capable with cgroup v2 linux kernel feature (for example FP3 doesn't have, redfin has)
- after the device is quiet for a while (~1 hour? activating battery-saving android feature may speedup this move to frozen state)
Current MR follow AOSP documentation recommendation: https://source.android.com/docs/core/perf/cached-apps-freezer#handling-custom-features As a workaround, if an app has a process that needs to perform activities while cached, change the process status to non-cached (such as Bound ForeGround Service (BFGS) or foreground)
This as a consequence for the user it requires to display a notification :
Technical details
Tests
Before this fix, I managed to reproduce the "internet issue" with the following steps, on a redfin A15, with AdvancedPrivacy from eOS 3.1.0Beta 2
The steps I did :
- Enable in developer settings "suspend execution for cached apps" instead of ("device default")
- Activate Battery saver
- Disconnect the phone for at least 30minutes
- Then, open browser, and try to load a webpage
Issues
https://gitlab.e.foundation/e/os/backlog/-/issues/3399
10 commandments of code review
Summary by CodeRabbit
-
New Features
- Improved notification support for the tracker service, including a new notification title available in English, German, Spanish, French, and Italian.
- The tracker service now starts as a system-exempted foreground service for enhanced reliability.
-
Chores
- Updated app permissions to support the new foreground service requirements.
- Removed obsolete foreground service helper code.