I'm developing a player app. For this reason, it uses a foreground service to handle the playback. Until recently the service was bound to my activities. This is not the case anymore. Since then, some specific devices (mostly Pixel 1/2/3) have been killing my app 1 minute after the screen has been turned off The service is a foreground service not bound to anything. Why would the device kill it? As soon as the app is excluded from the device-optimized apps list the issue is solved
I'm not providing code, because I'm just trying to understand if this situation makes sense and if so what should I do to prevent this
BTW the app is using a receiver to act on Screen_ON/OFF messages. That's how I can see in the logs that the player service onDestroy() method gets killed exactly 1 minute after the screen has been turned off