0

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:

  1. Scheduling the alarm manager for several seconds with pending intent that starts service.
  2. Collapsing the application and turning off the screen
  3. 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.

luckyfish
  • 31
  • 6

1 Answers1

0

You can try the below link. The author who did the network call once a service is started and got the exception as you expected in Android Oreo.

Android 8.0: java.lang.IllegalStateException: Not allowed to start service Intent

May be the same approach helps for you to reproduce the issue.

Uma Sankar
  • 449
  • 1
  • 8
  • 19