From f1318a7a55fb5edf8134b429594be667a9fd2e59 Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Thu, 15 Jun 2023 16:09:44 +0800 Subject: [PATCH] Remove previous workaround for setColorMode to WCG In previous CL ag/4296212, that fix is to workaround from jank while setColorMode on some specific chipset. By check on current Android, the app won't switch color mode during launch anymore, also that chipset should already phase out. Bug: 284449462 Test: atest ActivityTransitionTests Test: open/close photos in WCG, verify no jank Change-Id: I13d6115a6319131c786161632c0c055b3c4f2353 --- .../com/android/server/wm/ActivityRecord.java | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 788bfbcd65c95..2da55d372e285 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -108,7 +108,6 @@ import static android.os.Build.VERSION_CODES.O; import static android.os.InputConstants.DEFAULT_DISPATCHING_TIMEOUT_MILLIS; import static android.os.Process.SYSTEM_UID; import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER; -import static android.view.Display.COLOR_MODE_DEFAULT; import static android.view.Display.INVALID_DISPLAY; import static android.view.Surface.ROTATION_270; import static android.view.Surface.ROTATION_90; @@ -4668,26 +4667,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } /** - * @return Whether we are allowed to show non-starting windows at the moment. We disallow - * showing windows while the transition animation is playing in case we have windows - * that have wide-color-gamut color mode set to avoid jank in the middle of the - * animation. + * @return Whether we are allowed to show non-starting windows at the moment. */ boolean canShowWindows() { - final boolean drawn = mTransitionController.isShellTransitionsEnabled() + return mTransitionController.isShellTransitionsEnabled() ? mSyncState != SYNC_STATE_WAITING_FOR_DRAW : allDrawn; - final boolean animating = mTransitionController.isShellTransitionsEnabled() - ? mTransitionController.inPlayingTransition(this) - : isAnimating(PARENTS, ANIMATION_TYPE_APP_TRANSITION); - return drawn && !(animating && hasNonDefaultColorWindow()); - } - - /** - * @return true if we have a window that has a non-default color mode set; false otherwise. - */ - private boolean hasNonDefaultColorWindow() { - return forAllWindows(ws -> ws.mAttrs.getColorMode() != COLOR_MODE_DEFAULT, - true /* topToBottom */); } @Override