From c0095e5184d1c33a79f6805f7227283ced96b856 Mon Sep 17 00:00:00 2001 From: Issei Suzuki Date: Wed, 16 Jun 2021 16:31:51 +0200 Subject: Stop animation when screen times out and the user turns on the phone. Test: manual. 1. set lock mode to none (keep showing Settings activity) 2. wait until the screen times out 3. tap screen to turn on the screen 4. verity no animation is applied on the Settings activity Bug: 189438446 Change-Id: I5d7d0983e1d3f1dc5731eac1606417863a890e65 --- .../core/java/com/android/server/wm/RootWindowContainer.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java index ea80b8bb5286..968cd3e37276 100644 --- a/services/core/java/com/android/server/wm/RootWindowContainer.java +++ b/services/core/java/com/android/server/wm/RootWindowContainer.java @@ -220,6 +220,9 @@ class RootWindowContainer extends WindowContainer // transaction from the global transaction. private final SurfaceControl.Transaction mDisplayTransaction; + // The tag for the token to put root tasks on the displays to sleep. + private static final String DISPLAY_OFF_SLEEP_TOKEN_TAG = "Display-off"; + /** The token acquirer to put root tasks on the displays to sleep */ final ActivityTaskManagerInternal.SleepTokenAcquirer mDisplayOffTokenAcquirer; @@ -449,7 +452,7 @@ class RootWindowContainer extends WindowContainer mService = service.mAtmService; mTaskSupervisor = mService.mTaskSupervisor; mTaskSupervisor.mRootWindowContainer = this; - mDisplayOffTokenAcquirer = mService.new SleepTokenAcquirerImpl("Display-off"); + mDisplayOffTokenAcquirer = mService.new SleepTokenAcquirerImpl(DISPLAY_OFF_SLEEP_TOKEN_TAG); } boolean updateFocusedWindowLocked(int mode, boolean updateInputWindows) { @@ -2653,12 +2656,14 @@ class RootWindowContainer extends WindowContainer Slog.d(TAG, "Remove non-exist sleep token: " + token + " from " + Debug.getCallers(6)); } mSleepTokens.remove(token.mHashKey); - final DisplayContent display = getDisplayContent(token.mDisplayId); if (display != null) { display.mAllSleepTokens.remove(token); if (display.mAllSleepTokens.isEmpty()) { mService.updateSleepIfNeededLocked(); + if (token.mTag.equals(DISPLAY_OFF_SLEEP_TOKEN_TAG)) { + display.mSkipAppTransitionAnimation = true; + } } } } -- cgit v1.2.3-59-g8ed1b