Skip to content

Android 15: RemoteServiceException$ForegroundServiceDidNotStopInTimeException: A foreground service of type dataSync did not stop within its timeout: ComponentInfo{PackageName/net.gotev.uploadservice.UploadService} #676

Open
@surendar4

Description

@surendar4

Is your feature request related to a problem? Please describe.

Android 15 introduces a new timeout behavior to data-sync foreground services. The system permits an app's dataSync services to run for a total of 6 hours in a 24-hour period, after which the system calls the running service's Service.onTimeout(int, int) method (introduced in Android 15). At this time, the service has a few seconds to call Service.stopSelf(). When Service.onTimeout() is called, the service is no longer considered a foreground service. If the service does not call Service.stopSelf(), the system throws an internal exception.

Describe the solution you'd like
We can update the target version to Android 15 and introduce a serviceTimeout() callback in RequestObserverDelegate. This allows apps to listen for the callback and handle it by retrying any remaining file uploads when the app returns to the foreground.

Are you willing to implement it and maintain it?

  • Yes
  • Can implement it with a Pull Request, but not maintain it
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions