Fix flaky TaskFragmentOrganizerTest#testFinishActivity

Before, we used waitForAppTransitionIdleOnDisplay which doesn't
guarantee that the activity destroy transaction item has reached the app
process. Now, we wait and test the system window state instead.

Fix: 254725836
Test: atest CtsWindowManagerDeviceTestCases:TaskFragmentOrganizerTest
      #testFinishActivity

Change-Id: I5ed99ae978e059e71f7ef170df8beb8a368e1fbf
(cherry picked from commit f1e047a6691accc546d8e86982e44d4d9135a9e7)
Merged-In: I5ed99ae978e059e71f7ef170df8beb8a368e1fbf
1 file changed