You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Android 12 and later versions are designed to terminate foreground services automatically after days or weeks.
09-17 08:02:23.129 2670 2818 W ActivityManager: Exception when unbinding service com....otm.v3/com....otm.vpn.service.FilterService
09-17 08:02:23.129 2670 2818 W ActivityManager: android.os.DeadObjectException
If you check the logs and your service was a STICKY one, the ActivityManager is automatically restarting it with the following kill reason: ActivityManager: Rescheduling restart of crashed service com.cujo.otm.v3/.service.CujoService in 9967ms formem-pressure-event - mem pressure is the reason in my case. Just follow the LogCat and find yours
This means that the onStartCommand has already been called, but with a null intent.
In this situation, you will need to manually reinitialize everything.
The text was updated successfully, but these errors were encountered:
cj-marius-duna
changed the title
Fixed - foreground services are killed by the OS but there is a solution
Fixed - foreground services are killed by the OS but there is a catch
Oct 15, 2024
Hello @Duna@cj-marius-duna .. in my opinion this is nothing special in Android 12.. this is how FGS (or in earlier Android simply Services) worked on from the well "beginning". Even when the the service was sticky system may restart the service any time when memory is getting low and you need to cope with that in the code... for instacne expect intent to be null or expect a flow when onCreate is not called in the lifecycle but only onStartCommand...
Android 12 and later versions are designed to terminate foreground services automatically after days or weeks.
If you check the logs and your service was a STICKY one, the ActivityManager is automatically restarting it with the following kill reason:
ActivityManager: Rescheduling restart of crashed service com.cujo.otm.v3/.service.CujoService in 9967ms for
mem-pressure-event - mem pressure is the reason in my case. Just follow the LogCat and find yoursThis means that the
onStartCommand
has already been called, but with anull
intent.In this situation, you will need to manually reinitialize everything.
The text was updated successfully, but these errors were encountered: