App with foreground service is being put to sleep on Samsung Android 9.0 device
On Samsung S9 Android 9.0 device, we observe that our app that runs with foreground service and notification is being put to sleep.
It automatically gets added under App Power Management Settings -> Sleeping Apps.
When that happens, app is no longer running. We confirmed this with adb shell ps command.
It is reproducible by setting the Sleep delay in Settings to 1 day and putting any of the App activity in background.
Is it expected that App with foreground service/notification will be put to sleep automatically?
Is there a way to programatically whitelist against app sleep? Or, can App register a callback to wake itself up after sometime.
This issue was not seen on Android 8.0 devices.
- Drawing for Samsung A3 2017
- Clicking on a relationship contact on a Samsung Tab A does not show that contact
- Keep Wifi on / disable Doze mode
- Knox 3.x versions of SmartCardEmailPolicy and SmartCardBrowserPolicy?
- Connect Auto OBD-II device support
- Anroid standard api, How to add an app that is not in sleep mode(power save mode)?