Don't crash apps unfairly under FAS

When an app calls startForegroundService() from a bg state (e.g. from a
broadcast receiver) but the user has placed it under FAS, it's incorrect
to crash the app:  it hasn't actually violated the fg/bg restrictions
contract.  Fail quietly instead, just like the legacy-app case when O+
restrictions are imposed on it.

Change-Id: I3e8ed2ea6bdbf4167249132ddf9b7c549b9a8062
Fixes: 79235311
Test: ApiDemos [before and after changing target sdk to O+]
Test: atest android.app.cts.ServiceTest
1 file changed