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

Commit cf0d1807 authored by Varun Shah's avatar Varun Shah Committed by Android (Google) Code Review
Browse files

Merge "Added an app id security check in isAppForeground."

parents 173fdc4d 5cf9f41e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -5138,6 +5138,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) {