Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7408813e authored by Christopher Tate's avatar Christopher Tate
Browse files

Check bg persistent-app policy against base uid, not nominal

SysUI, for example, needs to be able to start services in secondary
users, and in those users they run as the user-appropriate decorated
uid.

Bug 35200453
Test: verify user switch behavior via logging

Change-Id: Ia154f140e315fd97aed414c6444ba550632eb610
parent 5d99e14c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -8115,8 +8115,8 @@ public class ActivityManagerService extends IActivityManager.Stub
    // of service-launch policy, allow those callers to proceed unrestricted.
    int appServicesRestrictedInBackgroundLocked(int uid, String packageName, int packageTargetSdk) {
        // Persistent app?  NB: expects that persistent uids are always active.
        final UidRecord uidRec = mActiveUids.get(uid);
        if (uidRec != null && uidRec.persistent) {
        final UidRecord appIdRec = mActiveUids.get(UserHandle.getAppId(uid));
        if (appIdRec != null && appIdRec.persistent) {
            if (DEBUG_BACKGROUND_CHECK) {
                Slog.i(TAG, "App " + uid + "/" + packageName
                        + " is persistent; not restricted in background");