From d6d2675d676b1afb2e44f42b7021a50690032a64 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Thu, 25 May 2017 13:57:46 -0700 Subject: [PATCH] Update ActivityStack#removeActivityFromHistoryLocked documentation. Followup to ag/2187696 Test: Documentation only Bug: 37752430 Change-Id: I6e6a1e6727793037b398ef5b2da58d9efad4ada0 --- services/core/java/com/android/server/am/ActivityStack.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 93187731e1578..93e1ab4629458 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -4042,6 +4042,9 @@ class ActivityStack extends ConfigurationContai mStackSupervisor.moveHomeStackTaskToTop(reason); } + // The following block can be executed multiple times if there is more than one overlay. + // {@link ActivityStackSupervisor#removeTaskByIdLocked} handles this by reverse lookup + // of the task by id and exiting early if not found. if (onlyHasTaskOverlays) { // When destroying a task, tell the supervisor to remove it so that any activity it // has can be cleaned up correctly. This is currently the only place where we remove @@ -4054,7 +4057,8 @@ class ActivityStack extends ConfigurationContai !REMOVE_FROM_RECENTS, PAUSE_IMMEDIATELY); } - // We must keep the task around until all activities are destroyed. + // We must keep the task around until all activities are destroyed. The following + // statement will only execute once since overlays are also considered activities. if (lastActivity) { removeTask(task, reason, REMOVE_TASK_MODE_DESTROYING); }