Skip to content

Add serviceTypes as an argument to the updateService method#386

Open
Marika-Fukazawa wants to merge 1 commit into
Dev-hwang:masterfrom
Marika-Fukazawa:master
Open

Add serviceTypes as an argument to the updateService method#386
Marika-Fukazawa wants to merge 1 commit into
Dev-hwang:masterfrom
Marika-Fukazawa:master

Conversation

@Marika-Fukazawa

Copy link
Copy Markdown

Motivation

Android 15 introduces timeout restrictions for some foreground service types
such as dataSync and mediaProcessing.

Currently, changing the foreground service type requires stopping and
restarting the service, which may create a period where no foreground
service is running.

This PR allows updating foreground service types through updateService()
without restarting the service.

Changes

  • Added optional serviceTypes parameter to updateService()
  • Updated Android implementation to refresh foreground service types
    using startForeground(...)
  • Updated README with usage examples and notes

Verification

Verified on Android 14, Android 16.

  • dataSync -> connectedDevice
  • connectedDevice -> dataSync
  • notification updates continue to work
  • service remains running without restart

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