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

Commit 0b7c38cb authored by Louis Chang's avatar Louis Chang
Browse files

Fix launch time metric of the placeholder activity launch

The plaseholder Activity is started with avoid-move-to-front option.
So the launch time is not tracked.

Bug: 382353428
Test: start AE app with placeholder rule
Flag: EXEMPT bugfix
Change-Id: I4fa7e7eb01c94b0eb7c7f31d75c4324470c438a6
parent 2462b4d1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import static android.app.ActivityManager.START_RETURN_INTENT_TO_CALLER;
import static android.app.ActivityManager.START_RETURN_LOCK_TASK_MODE_VIOLATION;
import static android.app.ActivityManager.START_SUCCESS;
import static android.app.ActivityManager.START_TASK_TO_FRONT;
import static android.app.ActivityManager.isStartResultSuccessful;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.app.PendingIntent.FLAG_CANCEL_CURRENT;
import static android.app.PendingIntent.FLAG_ONE_SHOT;
@@ -891,7 +892,10 @@ class ActivityStarter {
                final ActivityOptions originalOptions = mRequest.activityOptions != null
                        ? mRequest.activityOptions.getOriginalOptions() : null;
                // Only track the launch time of activity that will be resumed.
                launchingRecord = mDoResume ? mLastStartActivityRecord : null;
                if (mDoResume || (isStartResultSuccessful(res)
                        && mLastStartActivityRecord.getTask().isVisibleRequested())) {
                    launchingRecord = mLastStartActivityRecord;
                }
                // If the new record is the one that started, a new activity has created.
                final boolean newActivityCreated = mStartActivity == launchingRecord;
                // Notify ActivityMetricsLogger that the activity has launched.