I'm using Transitions API
and everything works fine for the first 24-48 hours - I receive physical activity changes from the API, but after 24-48 hours there's nothing.
Under Transitions API Receiver, I use Foreground Service
that is still alive after those 48 hours. I can verify that by seeing logs; additionally, Location (Fused Location Client)
updates are still coming in after those 24-48 hours whereas Transition API seems to be dead.
Has anyone experienced this? I do think that maybe resetting (unregister and then register again) Transitions API using Worker might be alternative (every 1-2 hrs). Not sure if this would help. I have a feeling this happens when app enters Doze mode/some kind of sleep state.
Also, my foreground service uses exported=false
, maybe setting it to true
would help? (I would love for someone to give an answer and explaining why you should use one or another)
OS: Android 12