diff options
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerShellCommand.java | 7 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityStarter.java | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java index 4f6f9fd23175..85322d611f41 100644 --- a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java +++ b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java @@ -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()); } diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java index 9f04166ea4c0..49a573fdb197 100644 --- a/services/core/java/com/android/server/wm/ActivityStarter.java +++ b/services/core/java/com/android/server/wm/ActivityStarter.java @@ -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; @@ -1305,6 +1307,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)) { |