Cancel pending launch only if its removed process wasn't attached
There could be a corner race: Low-memory-killer kills a process which is the target process of a launching activity. Assume binder thread T1, T2: T1 receives binder died. T1 sets thread null. From AMS: handleAppDiedLocked > handleAppDiedLocked > onCleanupApplicationRecordLSP > makeInactive > WindowProcessController#setThread) T2 previous activity paused triggers to resume next top activity, then requests to start process because thread is null. From ActivityTaskSupervisor#startSpecificActivity T1 removes died process record. From AMS: handleAppDiedLocked > cleanUpApplicationRecordLocked > removeProcessNameLocked > ATMI:onProcessRemoved > remove launching activities The activity removal in onProcessRemoved only focuses on handling process which hasn't completed attach (i.e. no binder died). Bug: 360797479 Flag: EXEMPT bugfix Test: atest RootWindowContainerTests#testAttachApplication Change-Id: I36484c634fa3e97194d3e60a9d33d0490051570f
Loading
Please register or sign in to comment