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

Commit 7f812ed0 authored by Varun Shah's avatar Varun Shah Committed by android-build-merger
Browse files

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

am: c0175af9

Change-Id: Iea98c1411920bdd15f43f0044065e6d9f52703d0
parents 75418ebf c0175af9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -8624,6 +8624,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) {