summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author wilsonshih <wilsonshih@google.com> 2023-06-09 03:22:43 +0000
committer wilsonshih <wilsonshih@google.com> 2023-06-09 07:07:29 +0000
commit14b30bd4982cbf0333dee23916520a593b3bd456 (patch)
tree8336f233fa6180a17a0fd6fca518ead717b7dd5a
parent9087af02757460699c7258f73758ea3118cc4f2e (diff)
Skip transfer starting window from above if current activity has drawn.
If transferred, there is no signal to remove the starting window since the activity is already drawn. The starting window will be remove with above activity. Bug: 283887866 Test: atest ActivityRecordTests SplashscreenTests Change-Id: I0728db35ba8c476290d44462a040de77ab5986b7
-rw-r--r--services/core/java/com/android/server/wm/ActivityRecord.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 9f16a8441533..89a4a13c9bd9 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -4550,6 +4550,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
* immediately finishes after, so we have to transfer T to M.
*/
void transferStartingWindowFromHiddenAboveTokenIfNeeded() {
+ final WindowState mainWin = findMainWindow(false);
+ if (mainWin != null && mainWin.mWinAnimator.getShown()) {
+ // This activity already has a visible window, so doesn't need to transfer the starting
+ // window from above activity to here. The starting window will be removed with above
+ // activity.
+ return;
+ }
task.forAllActivities(fromActivity -> {
if (fromActivity == this) return true;
return !fromActivity.isVisibleRequested() && transferStartingWindow(fromActivity);