Mark the persistent flag while creating the ProcessRecord

...if it's a persistent app indeed.

As we're not necessarily reusing the ProcessRecord now - including
persistent process - this was to handle the case where the old
process has been killed but not cleaned up, and the new process
creation request comes in - in this case, we'll create a new
ProcessRecord. If we do so, we need to set the persistent flag
correctly to the new ProcessRecord.

Bug: 230296979
Test: Manual
Change-Id: I2c8f8d054c64a8dd97ee4913779e927464382525
This commit is contained in:
Jing Ji
2022-06-07 18:31:33 -07:00
parent 2e6039cd73
commit 63752a84bb

View File

@@ -2996,9 +2996,10 @@ public final class ProcessList {
hostingRecord.getDefiningUid(), hostingRecord.getDefiningProcessName());
final ProcessStateRecord state = r.mState;
if (!mService.mBooted && !mService.mBooting
if (!isolated && !isSdkSandbox
&& userId == UserHandle.USER_SYSTEM
&& (info.flags & PERSISTENT_MASK) == PERSISTENT_MASK) {
&& (info.flags & PERSISTENT_MASK) == PERSISTENT_MASK
&& (TextUtils.equals(proc, info.processName))) {
// The system process is initialized to SCHED_GROUP_DEFAULT in init.rc.
state.setCurrentSchedulingGroup(ProcessList.SCHED_GROUP_DEFAULT);
state.setSetSchedGroup(ProcessList.SCHED_GROUP_DEFAULT);