Treat it dead if the process record's pid is invalid

Bug: 146430891
Test: Manual
Change-Id: I98bf86d2a0ee2be2ecdd613e547dbdb0fd621e95
This commit is contained in:
Jing Ji
2019-12-26 13:31:06 -08:00
parent 56eb64faef
commit d515b7d080

View File

@@ -2101,6 +2101,10 @@ public final class ProcessList {
*/
@GuardedBy("mService")
private boolean isProcessAliveLiteLocked(ProcessRecord app) {
// If somehow the pid is invalid, let's think it's dead.
if (app.pid <= 0) {
return false;
}
try {
Os.kill(app.pid, 0);
} catch (ErrnoException e) {