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

Commit c0175af9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "RESTRICT AUTOMERGE: Added an app id security check in isAppForeground." into pi-dev

parents 94a49c90 273eb091
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -8768,6 +8768,14 @@ public class ActivityManagerService extends IActivityManager.Stub
    @Override
    public boolean isAppForeground(int uid) {
        int callerUid = Binder.getCallingUid();
        if (UserHandle.isCore(callerUid) || callerUid == uid) {
            return isAppForegroundInternal(uid);
        }
        return false;
    }
    private boolean isAppForegroundInternal(int uid) {
        synchronized (this) {
            UidRecord uidRec = mActiveUids.get(uid);
            if (uidRec == null || uidRec.idle) {