Avoid killing task process after its activity was died
Some tests may have the order:
1. removeTask in tearDown
Schedule KILL_TASK_PROCESSES_TIMEOUT_MSG to wait for the
activity to be destroyed.
2. forceStopPackage in tearDown
The process is forced killed, but the scheduled timeout is
not cleared.
3. Launch the app again in a short time
If the timeout reaches before the activity attached to
the new process, the process will be killed so the test
is failed due to target activity not detected.
Originally the pending-kill state is consumed (clear flag and kill
task processes) only when the activity is destroyed. So this change
ensures it is done by the general cleanup that is also called when
the process died.
Bug: 293280011
Test: atest RecentTasksTest#testRemovePackageByName
Merged-In: I8cf8d67cc7cd39b6cc8db91498dc901f494ae85e
Change-Id: I8cf8d67cc7cd39b6cc8db91498dc901f494ae85e
3 files changed