From b31fe6129560df63a96a3842e4d0db79689ea4b8 Mon Sep 17 00:00:00 2001 From: Josh Tsuji Date: Tue, 12 Oct 2021 16:16:44 -0400 Subject: [PATCH] Don't play the screen off animation if we disabled animations system-wide. This setting works by setting animator durations to zero, but the screen off animation is way too complicated for that to work well. Fixes: 202086856 Test: screen off with and without animations enabled in a11y settings Change-Id: I13e9ef2f33a3fd29ac189123e7398277111ada5a --- .../statusbar/phone/UnlockedScreenOffAnimationController.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt index f3f3325f49d7e..fdc0ec5b9089c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt @@ -226,6 +226,12 @@ class UnlockedScreenOffAnimationController @Inject constructor( return false } + // If animations are disabled system-wide, don't play this one either. + if (Settings.Global.getString( + context.contentResolver, Settings.Global.ANIMATOR_DURATION_SCALE) == "0") { + return false + } + // We only play the unlocked screen off animation if we are... unlocked. if (statusBarStateControllerImpl.state != StatusBarState.SHADE) { return false