Revert^2 "Defer destroy activity if it is in transition."
This reverts commit 145e8fa4a7fb498385257d546b2b67e314f69687.
Reason for revert: Original CL need to consider if the finish activity
is the last activity in the display, there is no close display
transition right now.
Test: atest CarActivityManagerTest
Bug: 343671768
Bug: 318877215
Bug: 323129567
Change-Id: Ia405ec2d8229f2ff7668be5361eb48f9c5793f2e
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 434e92f..e24a597 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -3964,7 +3964,7 @@
}
if (isCurrentVisible) {
- if (isNextNotYetVisible || delayRemoval) {
+ if (isNextNotYetVisible || delayRemoval || (next != null && isInTransition())) {
// Add this activity to the list of stopping activities. It will be processed and
// destroyed when the next activity reports idle.
addToStopping(false /* scheduleIdle */, false /* idleDelayed */,