fix persistent process is killed and restart again and again

start presistent app  before system booting, in NewProcessRecordLocked
will set  persistent = true, but not set r.maxAdj = ProcessList.PERSISTENT_PROC_ADJ.
so this process  may become CACHED_EMPTY, then be killed.
while persistent = true, will restart again.

https://code.google.com/p/android/issues/detail?id=222224

Change-Id: I91b405ca3f3bbe8934e4a495d9a54eab4f51e21f
This commit is contained in:
yuanhuihui
2016-09-12 17:52:18 +08:00
parent f7c508ae09
commit 05efd438fe

View File

@@ -11429,6 +11429,7 @@ public final class ActivityManagerService extends ActivityManagerNative
&& userId == UserHandle.USER_SYSTEM
&& (info.flags & PERSISTENT_MASK) == PERSISTENT_MASK) {
r.persistent = true;
r.maxAdj = ProcessList.PERSISTENT_PROC_ADJ;
}
addProcessNameLocked(r);
return r;