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

Commit 3ee5fc0a authored by Louis Chang's avatar Louis Chang
Browse files

Showing starting window after activity flags applied

Starting window was shown while brought an existing task to front and
that had increased Phone hot launch time.

Before bde91e94, a single-task activity (like Phone) had the new intent set
in earlier flow and the snapshot starting window was not allowed to show if
an intent (other than main) had set, see AR#allowTaskSnapshot(). So, there
was no starting window during hot launch.

Showing starting window after activity flags are applied, where the
new intent (if any) were set, and doing so if the task had moved to front.

Bug: 141271584
Test: adb shell am instrument -w \
      -e class com.android.tests.applaunch.AppLaunch \
      -e launch_directory '/storage/emulated/0/Download' \
      -e apps 'Phone^Phone' -e trial_launch true -e force_stop_app false \
      -e launch_iterations 100 \
      com.android.tests.applaunch/android.test.InstrumentationTestRunner

Change-Id: Ic87c064840fead057ccc305e5580db1dfa806b33
parent e76e96bd
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1743,7 +1743,12 @@ class ActivityStarter {
            return START_SUCCESS;
        }

        if (!mMovedToFront && mDoResume) {
        if (mMovedToFront) {
            // We moved the task to front, use starting window to hide initial drawn delay.
            targetTaskTop.showStartingWindow(null /* prev */, false /* newTask */,
                    true /* taskSwitch */);
        } else if (mDoResume) {
            // Make sure the stack and its belonging display are moved to topmost.
            mTargetStack.moveToFront("intentActivityFound");
        }
        // We didn't do anything...  but it was needed (a.k.a., client don't use that intent!)
@@ -2349,11 +2354,6 @@ class ActivityStarter {
                }

                mOptions = null;

                // We are moving a task to the front, use starting window to hide initial drawn
                // delay.
                intentActivity.showStartingWindow(null /* prev */, false /* newTask */,
                        true /* taskSwitch */);
            }
        }
        // Need to update mTargetStack because if task was moved out of it, the original stack may