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

Commit fbdcc72d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix reporting HOT launch state while required to restart process"

parents 268e3ac0 0513a940
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -492,7 +492,6 @@ final class ActivityManagerShellCommand extends ShellCommand {
            final long endTime = SystemClock.uptimeMillis();
            PrintWriter out = mWaitOption ? pw : getErrPrintWriter();
            boolean launched = false;
            boolean hotLaunch = false;
            switch (res) {
                case ActivityManager.START_SUCCESS:
                    launched = true;
@@ -518,8 +517,6 @@ final class ActivityManagerShellCommand extends ShellCommand {
                    break;
                case ActivityManager.START_TASK_TO_FRONT:
                    launched = true;
                    //TODO(b/120981435) remove special case
                    hotLaunch = true;
                    out.println(
                            "Warning: Activity not started, its current "
                                    + "task has been brought to the front");
@@ -567,9 +564,7 @@ final class ActivityManagerShellCommand extends ShellCommand {
                    result.who = intent.getComponent();
                }
                pw.println("Status: " + (result.timeout ? "timeout" : "ok"));
                final @WaitResult.LaunchState int launchState =
                        hotLaunch ? WaitResult.LAUNCH_STATE_HOT : result.launchState;
                pw.println("LaunchState: " + launchStateToString(launchState));
                pw.println("LaunchState: " + launchStateToString(result.launchState));
                if (result.who != null) {
                    pw.println("Activity: " + result.who.flattenToShortString());
                }
+4 −0
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@ 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.WaitResult.LAUNCH_STATE_COLD;
import static android.app.WaitResult.LAUNCH_STATE_HOT;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
@@ -1311,6 +1313,8 @@ class ActivityStarter {
                        break;
                    }
                    case START_TASK_TO_FRONT: {
                        outResult.launchState =
                                r.attachedToProcess() ? LAUNCH_STATE_HOT : LAUNCH_STATE_COLD;
                        // ActivityRecord may represent a different activity, but it should not be
                        // in the resumed state.
                        if (r.nowVisible && r.isState(RESUMED)) {