Merge "Fix issue #62196301: Pre-O background restrictions allow starts..." into oc-dev

This commit is contained in:
Dianne Hackborn
2017-05-31 00:12:58 +00:00
committed by Android (Google) Code Review

View File

@@ -8447,8 +8447,8 @@ public class ActivityManagerService extends IActivityManager.Stub
synchronized (mPidsSelfLocked) {
proc = mPidsSelfLocked.get(callingPid);
}
if (proc != null && proc.curProcState
< ActivityManager.PROCESS_STATE_RECEIVER) {
if (proc != null &&
!ActivityManager.isProcStateBackground(proc.curProcState)) {
// Whoever is instigating this is in the foreground, so we will allow it
// to go through.
return ActivityManager.APP_START_MODE_NORMAL;