Skip to content

start foreground service irrespective of location permission - #4589

Merged
mdmohsin7 merged 1 commit into
mainfrom
no-location-check
Feb 3, 2026
Merged

mdmohsin7 merged 1 commit into
mainfrom
no-location-check

Conversation

@mdmohsin7

Copy link
Copy Markdown
Member

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +267 to +268
await ForegroundUtil.initializeForegroundService();
await ForegroundUtil.startForegroundTask();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

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');
}

@mdmohsin7
mdmohsin7 merged commit fc9d032 into main Feb 3, 2026
1 check passed
@mdmohsin7
mdmohsin7 deleted the no-location-check branch February 3, 2026 11:51
Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant