Skip to content

ForegroundServiceDidNotStopInTimeException crash#4549

Open
aaravgarg wants to merge 1 commit intomainfrom
fix/android-crash-foreground-service-timeout
Open

ForegroundServiceDidNotStopInTimeException crash#4549
aaravgarg wants to merge 1 commit intomainfrom
fix/android-crash-foreground-service-timeout

Conversation

@aaravgarg
Copy link
Collaborator

Summary

  • Wrap recorder stop() in try-catch during both service stop and watchdog retire
  • Prevents errors during recorder cleanup from blocking stopSelf(), which causes ForegroundServiceDidNotStopInTimeException on Android
  • Ensures stopSelf() is always called even if recorder stop fails

Crash Stats

Test plan

  • Verify background service still stops correctly
  • Test force-stopping the app while recording (should not crash)

🤖 Generated with Claude Code

Prevent errors during recorder cleanup from blocking service stop,
which can cause ForegroundServiceDidNotStopInTimeException on Android.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@aaravgarg aaravgarg requested a review from mdmohsin7 February 1, 2026 23:30
@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

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