From 02165bf50c2980ef419e2b4e6eb141d7ae8f836d Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Wed, 12 May 2021 09:40:29 +0800 Subject: [PATCH] Provide a quick workaround for WM flaky tests Some ActivityRecord would leak after cts because of isAnimating. Which might caused from the starting window was transferred to the other activity after apply reveal animation on server side. Test: atest AmStartOptionsTests#testDashW_FinishingTop, then check there is no WindowState leak after test finish. Bug: 184830058 Change-Id: Id7a09ab141367f0e0788155c13d658f251b8fa1b --- .../java/com/android/server/wm/TaskOrganizerController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/TaskOrganizerController.java b/services/core/java/com/android/server/wm/TaskOrganizerController.java index fb481b41c0af6..a4c8db6f208fc 100644 --- a/services/core/java/com/android/server/wm/TaskOrganizerController.java +++ b/services/core/java/com/android/server/wm/TaskOrganizerController.java @@ -38,6 +38,7 @@ import android.os.Binder; import android.os.IBinder; import android.os.Parcel; import android.os.RemoteException; +import android.os.SystemProperties; import android.util.Slog; import android.util.proto.ProtoOutputStream; import android.view.SurfaceControl; @@ -75,6 +76,9 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub { private static final int REPORT_CONFIGS = CONTROLLABLE_CONFIGS; private static final int REPORT_WINDOW_CONFIGS = CONTROLLABLE_WINDOW_CONFIGS; + private static final boolean DEBUG_ENABLE_REVEAL_ANIMATION = + SystemProperties.getBoolean("persist.debug.enable_reveal_animation", false); + // The set of modes that are currently supports // TODO: Remove once the task organizer can support all modes @VisibleForTesting @@ -183,7 +187,7 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub { SurfaceControl windowAnimationLeash = null; Rect mainFrame = null; final boolean playShiftUpAnimation = !task.inMultiWindowMode(); - if (prepareAnimation && playShiftUpAnimation) { + if (prepareAnimation && playShiftUpAnimation && DEBUG_ENABLE_REVEAL_ANIMATION) { final ActivityRecord topActivity = task.topActivityWithStartingWindow(); if (topActivity != null) { final WindowState mainWindow =