Merge "RESTRICT AUTOMERGE: Added an app id security check in isAppForeground." into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c0175af954
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user