question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Application gets re-started from a background service (JobInfoSchedulerService) after app is closed

See original GitHub issue

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: AS Bumblebee 2021.1.1 Patch 2
  • Firebase Component: Analytics, Crashlytics, Performance, Dynamic Links, FCM, Core, Remote Config,
  • Component version: implementation platform(‘com.google.firebase:firebase-bom:29.3.1’)

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Close app (remove from tasks), wait some seconds, new app process is started resutling in that the app is executed in the background.

This issue did not happen when I completely removed all Firebase SDK dependencies. So it looks like there is a connection between the SDK and the app wake up in the background after the app has been closed completely. I also did a quick investigation to check which component is responsible for this behavior. It looks like the Service com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService is always started when the app is closed that results in a new app process which holds the app in the background.

2022-04-28 10:51:09.043 1621-1781/? I/ActivityManager: Start proc 31802:com.app/u0a342 for service {com.app/com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService}

Does one or more of the SDK components using this service?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
argzdevcommented, Apr 28, 2022

Thanks for reporting, @sin-ka. I was able to reproduce the issue, furthermore, I tried isolating each library and it looks like performance might be the one using this service. I’ll notify an engineer and see what we can do here.

0reactions
vkryachkocommented, May 2, 2022

Hi @sin-ka 2 things:

  1. As for the service: it’s not started/stopped by JobScheduler, but rather it’s bound, it’s up to job scheduler to bind to it and unbind from it, which I assume varies by android version and even oem. It should not matter much however, since the service would not consume any resources until jobscheduler calls into it via onStartJob/onStopJob.
  2. Stopping/unbinding from a service does not automatically kill the app’s process, the process can stick around, but JobInfoSchedulerService will not consume any resources and in the common case the host app should not be consuming any resources either(depending on the app).
Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Background Service is restarting when application is ...
If I get back to the app and I press start again, onCreate gets called which means that, as I wrote before, START_NOT_STICKY...
Read more >
Service | Android Developers
Global access to a service can be enforced when it is declared in its manifest's <service> tag. By doing so, other applications will...
Read more >
Find problem apps by rebooting to safe mode on Android
Try the steps below if your phone has any of these problems: Restarting itself. Freezing. Crashing. Running slow. Restart in safe mode. Important:...
Read more >
Auto-Start Foreground Service in Android - Medium
Basically, foreground service is a background process that remains in a running state even app closed and removed from the recent list.
Read more >
Apps is restarting when background location permission is ...
I'm requesting background location permission after foreground location ... 09-11 19:14:50.054 965 3370 D android.hardware.audio.service: Failed to fetch ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found