Fix invalid launch state reported to "am start -W"

If a launching activity starts another activity before it
finishes drawing, because it becomes invisible, it is dropped
from active transition info. The waiting result should not use
the intermediate state as the launch is completed.

Bug: 123355661
Bug: 149326995
Test: atest ActivityMetricsLoggerTests#testConsecutiveLaunch
Change-Id: I9a5776cc7895a8d62ca28700c18efa4fd8b7c33d
2 files changed