I'm trying to observe the background limitations that were introduced with Android Oreo release. One behavior that I'm interested in is the illegalStateException that should be thrown when you start service from the background. Unfortunately, I can't reproduce it.
I will list down my steps to reproduce, please correct me if I'm doing something wrong:
- Scheduling the alarm manager for several seconds with pending intent that starts service.
- Collapsing the application and turning off the screen
- Moving the app into the idle state
adb shell dumpsys deviceidle force-idle
.
Observed result: when the timeout expires, the service starts without a problem
I'm using emulator with unplugged charger mode.
Thanks in advance.