Skip to content
Commit fbf67aac authored by Hui Yu's avatar Hui Yu
Browse files

All FGS exemptions should be propagated via service bindings.

Previously, the BG-FGS-start capability can be passed down over service
binding, this was implemented in OomAdjuster, due to performance reason,
only an subset of FGS exemptions are passed down.

This new implementation move it out of OomAdjuster and can pass all FGS
exemptions. Instead of in OomAdjuster it can passed down over infinite
number of levels of chain binding, the new implementation will be passed
down one level.

First we call shouldAllowFgsStartForegroundLocked() on the callingUid
that starts the FGS, if the return is DENIED, we check if callingUid has
any service that is bound by another UID(clientUid), we call
shouldAllowFgsStartForegroundLocked() on clientUid.

To check if a BG-FGS-start is allowed by any clientUid over service
binding, looking for ""Background started FGS: " string in logcat, if
the "clientCallingPackage" field is non-null, the reason BG-FGS-start is
because of a clientUid and clientCallingPackage is clientUid's
packageName.

Bug: 188086703
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testFgsBindingFlagNone
Change-Id: Ia692201909cc5095f4aa25ba5a1588510054fb80
parent fc0a05e3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment