From b31fe6129560df63a96a3842e4d0db79689ea4b8 Mon Sep 17 00:00:00 2001 From: Josh Tsuji Date: Tue, 12 Oct 2021 16:16:44 -0400 Subject: [PATCH 1/3] 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 From 429a39689f747b90519fdc0f234d5a62b9d37ddc Mon Sep 17 00:00:00 2001 From: Josh Tsuji Date: Wed, 13 Oct 2021 12:20:00 -0400 Subject: [PATCH 2/3] Adjust unlock parameters so that the lockscreen content doesn't overlap with the app/launcher. Test: unlock swipe Fixes: 196363607 Change-Id: Id3de50c6dd5eb85fbc382ccac4d84c7d67f29639 --- .../systemui/keyguard/KeyguardUnlockAnimationController.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt index e51b60213446e..2cc564bf8452e 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt @@ -62,7 +62,7 @@ const val SURFACE_BEHIND_SCALE_PIVOT_Y = 0.66f * The dismiss amount is the inverse of the notification panel expansion, which decreases as the * lock screen is swiped away. */ -const val DISMISS_AMOUNT_SHOW_SURFACE_THRESHOLD = 0.1f +const val DISMISS_AMOUNT_SHOW_SURFACE_THRESHOLD = 0.25f /** * Dismiss amount at which to complete the keyguard exit animation and hide the keyguard. @@ -70,7 +70,7 @@ const val DISMISS_AMOUNT_SHOW_SURFACE_THRESHOLD = 0.1f * The dismiss amount is the inverse of the notification panel expansion, which decreases as the * lock screen is swiped away. */ -const val DISMISS_AMOUNT_EXIT_KEYGUARD_THRESHOLD = 0.3f +const val DISMISS_AMOUNT_EXIT_KEYGUARD_THRESHOLD = 0.4f /** * Initiates, controls, and ends the keyguard unlock animation. From 6ab3eb7c810c80ebdb547f44636eee15e5accd6d Mon Sep 17 00:00:00 2001 From: Josh Tsuji Date: Tue, 12 Oct 2021 14:43:59 -0400 Subject: [PATCH 3/3] Don't show the keyguard status bar if we're animating the screen off. Fixes: 201001767 Test: turn off the screen. currently no practical way to add a test because the status bar is only briefly visible during screen off Change-Id: I447f5c9ccb7958b9210892fd4821c88868460a81 --- .../phone/NotificationPanelViewController.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index 1dface6a5bc76..1ad17d08c9ae1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -4364,9 +4364,16 @@ public class NotificationPanelViewController extends PanelViewController { } } } else { - mKeyguardStatusBarViewController.updateViewState( - /* alpha= */ 1f, - keyguardShowing ? View.VISIBLE : View.INVISIBLE); + final boolean animatingUnlockedShadeToKeyguard = oldState == SHADE + && statusBarState == KEYGUARD + && mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying(); + if (!animatingUnlockedShadeToKeyguard) { + // Only make the status bar visible if we're not animating the screen off, since + // we only want to be showing the clock/notifications during the animation. + mKeyguardStatusBarViewController.updateViewState( + /* alpha= */ 1f, + keyguardShowing ? View.VISIBLE : View.INVISIBLE); + } if (keyguardShowing && oldState != mBarState) { if (mQs != null) { mQs.hideImmediately();