I start a service from a foreground activity with the following way:
Intent i = new Intent();
i.setComponent(new ComponentName("com.xxx.yyy", "com.xxx.yyy.SyncService"));
ComponentName c = ctx.startService(i);
But i get this exception
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { ... }: app is in background uid NULL
I call the startService from my app which is in the foreground, so restrictions Limits dont apply here.
HOWEVER
If i start manually the other app which holds the service and put it on the background, and then from my app call the service, works fine. But only if the other app is running in the background.