Add a new launch type for hot start with relaunched activity
An existing activity may be relaunched when moving from background
to front if the current configuration is changed and the activity
cannot handle the change.
The relaunch type was reported as a hot start because its process
is alive and the original activity exists. But the relaunch needs to
destroy the original activity and create a new instance, which may
even take longer time than a warm start. So the case should be
separated from hot start.
Also:
- Make WaitResult#launchState is always populated by
ActivityMetricsLogger, so "am start -W" can get consistent
launch type.
- Remove dead code in ActivityRecord#ensureActivityConfiguration
that it already early returns if !attachedToProcess.
Bug: 172528316
Test: atest ActivityMetricsLaunchObserverTests#testLaunchState
Change-Id: I3ef64ce1e23b2f13d42fa2b12bc31c0cdb4652fc
7 files changed