Skip to content

Conversation

@agrognetti
Copy link
Contributor

@agrognetti agrognetti commented Oct 27, 2025

Summary

Adds a way to test the observability signals are being created even when the application is hidden but running a foreground or background service.

How did you test this change?

No tests needed

Are there any deployment considerations?

No, the code added just changes the Sample App


Note

Adds Android foreground/background services that run 30s periodic observability logging, with new UI buttons to start them and manifest updates for permissions and service registration.

  • Android sample app:
    • Services:
      • Add ObservabilityForegroundService with notification channel and foreground execution.
      • Add ObservabilityBackgroundService for non-foreground execution.
      • Shared task launchObservabilityLoggingTask logs every 5s for 30s via LDObserve.
    • ViewModel:
      • Convert to AndroidViewModel and add startForegroundService() and startBackgroundService() helpers.
    • UI (MainActivity):
      • Add buttons to start foreground/background services.
    • Manifest:
      • Declare android.permission.FOREGROUND_SERVICE.
      • Register ObservabilityForegroundService and ObservabilityBackgroundService.

Written by Cursor Bugbot for commit 210ab48. This will update automatically on new commits. Configure here.

…is running

Adds a way to test the observability signals are being created even when the application is hidden but running a foreground or background service.

This includes:
- Adding a `FOREGROUND_SERVICE` permission to the `AndroidManifest.xml`.
- Registering `ObservabilityForegroundService` and `ObservabilityBackgroundService` in the manifest.
- Updating the ViewModel to `AndroidViewModel` to access the application context for starting services.
- Adding buttons to the `MainActivity` UI to trigger the start of each service.
@agrognetti agrognetti requested a review from a team as a code owner October 27, 2025 17:53
@agrognetti agrognetti merged commit fb9faeb into main Oct 30, 2025
23 checks passed
@agrognetti agrognetti deleted the agrognetti/O11Y-418 branch October 30, 2025 14:51
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.

3 participants