The ability to start FGS can be passed down by service binding.
1. Add field mAllowStartFgs in ProcessRecord to indicate this app can start FGS. 2. mAllowStartFgs is true if the process has * any of these permissions: START_ACTIVITIES_FROM_BACKGROUND, START_FOREGROUND_SERVICES_FROM_BACKGROUND, SYSTEM_ALERT_WINDOW * the process's uid is ROOT_UID, SYSTEM_UID, NFC_UID, SHELL_UID. * the process's proc state is higher or equals to PROCESS_STATE_BOUND_FOREGROUND_SERVICE. * the process's uid is DeviceOwner, or allowlisted by DeviceIdleController. 3. The mAllowStartFgs ability can be passed to another process by service binding. Except if the binder is PROCESS_STATE_PERSISTENT, this ability does not pass down. Bug: 171305836 Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testFgsBindingFlagNone Change-Id: I20d977ce7ae65316cdec2cd0ef9cf9bafec2adbd
Loading
Please register or sign in to comment