Repository navigation
start foreground service irrespective of location permission - #4589
Conversation
There was a problem hiding this comment.
Code Review
This pull request modifies the logic for starting the foreground service to do so unconditionally on mobile platforms. However, this introduces a critical privacy issue as the foreground service performs location tracking, and the change ignores the user's setting to disable it. My review includes a comment to revert this change to respect the user's privacy settings.
| await ForegroundUtil.initializeForegroundService(); | ||
| await ForegroundUtil.startForegroundTask(); |
There was a problem hiding this comment.
This change starts the foreground service regardless of the user's location preference (SharedPreferencesUtil().locationEnabled).
The foreground task handler (_ForegroundFirstTaskHandler) performs location tracking. By removing this check, the app will track the user's location even when they have explicitly disabled it in the settings. This is a privacy violation and goes against the user's choice. It also leads to unnecessary battery drain.
If the foreground service is required for other purposes, like keeping the transcription service alive, the location tracking logic within the service itself should be made conditional based on the user's preference. Since that file is not part of this PR, the current change should be reverted to respect the user's setting.
if (SharedPreferencesUtil().locationEnabled) {
await ForegroundUtil.initializeForegroundService();
await ForegroundUtil.startForegroundTask();
} else {
Logger.debug('Skipping foreground service: location is not enabled');
}
No description provided.