Consider multi TDAs in testAppLaunchCount

When running this test on single screen device (where tasks are
launched in the same TaskDisplayArea), the last background package
is updated when the HOME activity is paused. In a hierarchy with
multiple TaskDisplayArea there is no guarantee the Home Activity will
be paused as the activities we launch might be placed on a different
TaskDisplayArea.

To fix this we first launch and an activity with different package and
finish it immediately to make sure the background package is updated
in UserUsageStatsService, so the launch count for the test activities
could be updated.

Bug: 233607444
Test: cts-tradefed run commandAndExit cts -m CtsUsageStatsTestCases -t
android.app.usage.cts.UsageStatsTest#testAppLaunchCount
Verified on: Pixel 4 & Development device

Change-Id: Ifb3c6ceb81e9d5993a8299ae330e2e830fdf26c7
(cherry picked from commit c1be9e93e5b282311085422bb5858fb2cbee2112)
Merged-In: Ifb3c6ceb81e9d5993a8299ae330e2e830fdf26c7
3 files changed