Reduce flakiness of testForceStopPackageWontRestartProcess

Other tests may not clean up the launched activity. If there is
an activity record of the same package without process (died in
background), when force-stopping the package, the null process
cannot match the current died process to clear the activity. And
because resume-top will be executed when a visible activity is died,
that leads to restart the process of the previous dead activity.

Bug: 160236531
Test: atest CtsAppTestCases: \
      ActivityManagerTest#testForceStopPackageWontRestartProcess
Change-Id: Id4a4492c1e8d39e2518e30a81118aed6c6fb7635
1 file changed