Merge "Added an app id security check in isAppForeground."
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user