Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0200027d authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Use actual started activity as the out activity

This removed [1] that uses the existing activity of the reused
task if the launching activity is no-display. It was a fix for
[2] that compares the initial specified component when using
command "am start -W" to start a trampoline activity that starts
another activity.

Since metrics logger can track the latest started activity by
ActivityMetricsLogger.TransitionInfo#mLastLaunchedActivity, the
workaround is no longer needed (WaitInfo#matches can know the
updated launched activity).

Besides, a trampoline activity may not always declare no-display.
So the result may be inconsistent if it depends on no-display even
if the app launch steps are the same. From the perspective of
ActivityStarter, the out activity should be the started activity
rather than the activity which may be the next resumed target.
For the launch time measurement, the metrics logger should be
responsible to handle it. That would also help to preserve the
real launch chain of activities so that setLatestLaunchedActivity
can transfer the launch cookie without missing any records.

The change in ActivityMetricsLogger is to preserve the ability to
report launch time when a trampoline activity is launched on an
existing task and moves the task from background to front. The
started activity is the trampoline and it will finish immediately.
The one that will report drawn is the previous existing activity
on the task.

[1]: I55f47766e8cdf92e31b4ddd97864cb0f5f3b751a
[2]: I7c356a8d153ddc24603acc55749e9992f9000c3f

Bug: 429103772
Flag: EXEMPT bugfix
Test: atest ActivityStarterTests#testReportStartedNoDisplayActivity
Change-Id: I3402af8a2e0a641f9974ede03fb035d2d4f11575
parent 70d5e516
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment