Skip to content
Commit 0f8a5212 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Consolidate waiting list of visible and launched activity

Previously, when "am start -W $activityName" launches a new activity,
it just blindly catches for any next drawn activity. E.g. press home
key before the target activity is drawn, the launch result will show
the result of home.

The case of launching existing activity was handled separately because
the target component name is usually known, but the case of new
activity is unknown because it may be a trampoline that launches other
activities. Now the WaitInfo can track the launch sequence according
to the LaunchingState provided by ActivityMetricsLogger. So both the
cases can share the same logic with distinguishing the individual
launch events.

If a launch event is aborted, as the above example of returning to
home, ActivityMetricsLogger will know the original task is no longer
visible and notify to stop waiting the result. The launch state of
result will be set to LAUNCH_STATE_UNKNOWN with the original target
component name.

Bug: 129868870
Test: CtsWindowManagerDeviceTestCases:AmStartOptionsTests
      ActivityTaskSupervisorTests#testReportWaitingActivityLaunched

Change-Id: I201a275c780749cba570319d522b7921612c6ca3
parent a0334be8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment