Suppress all background-state services in user-forced app standby

Foreground services are treated as normal services when the user has
placed the app under FAS restrictions.  The API contract for the app
is unchanged -- for example, if the app calls startForegroundService()
in this state it will still ANR if it fails to call startForeground()
as promised.  All service starts are quietly suppressed unless the app
is showing foreground UI.

If an app is already running a foreground service when FAS is applied,
that service is taken out of the fg state and thereafter treated like an
ordinary background service in a background state:  after 1 minute, the
service is summarily stopped by the OS.

Bug: 73559697
Test: ApiDemos fg service suite
Test: atest CtsAppTestCases
Change-Id: Icc5fb180b90cb5d902e96aeb92a93f6daf00bd9b
4 files changed