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

Commit 444f688d authored by Christopher Tate's avatar Christopher Tate Committed by android-build-merger
Browse files

Merge "Don't crash apps unfairly under FAS" into pi-dev am: 7450f0c0

am: 711b5869

Change-Id: I7cb86e3ea6b43a7b7774b362b63e3aed6ce307ff
parents 4837c7c0 711b5869
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -476,12 +476,23 @@ public final class ActiveServices {
                Slog.w(TAG, "Background start not allowed: service "
                        + service + " to " + r.name.flattenToShortString()
                        + " from pid=" + callingPid + " uid=" + callingUid
                        + " pkg=" + callingPackage);
                        + " pkg=" + callingPackage + " startFg?=" + fgRequired);
                if (allowed == ActivityManager.APP_START_MODE_DELAYED || forceSilentAbort) {
                    // In this case we are silently disabling the app, to disrupt as
                    // little as possible existing apps.
                    return null;
                }
                if (forcedStandby) {
                    // This is an O+ app, but we might be here because the user has placed
                    // it under strict background restrictions.  Don't punish the app if it's
                    // trying to do the right thing but we're denying it for that reason.
                    if (fgRequired) {
                        if (DEBUG_BACKGROUND_CHECK) {
                            Slog.v(TAG, "Silently dropping foreground service launch due to FAS");
                        }
                        return null;
                    }
                }
                // This app knows it is in the new model where this operation is not
                // allowed, so tell it what has happened.
                UidRecord uidRec = mAm.mActiveUids.get(r.appInfo.uid);