diff options
| author | 2021-04-26 17:04:19 -0700 | |
|---|---|---|
| committer | 2021-04-26 17:52:56 -0700 | |
| commit | 80e9f0d66e42e891eedc54620c9569f85b10c525 (patch) | |
| tree | 8be7d0c58dfc30744e59545b21e0cb777d057efa | |
| parent | a80a2548ca3c583c86bf7d50eada94e50fc053df (diff) | |
Don't animate depth when changing brightness
On S, the wallpaper is zoomed out when the shade is down, we do not have
to do anything specific to the brightness mirror anymore.
Fixes: 186010374
Test: manual
Test: atest NotificationShadeDepthControllerTest
Change-Id: I9347708026045b7833aa51a9cfbb9ad2e6ee4321
3 files changed, 0 insertions, 41 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt index 2a468938ecff..e8ce5f952b3b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt @@ -98,15 +98,6 @@ class NotificationShadeDepthController @Inject constructor( var globalActionsSpring = DepthAnimation() var showingHomeControls: Boolean = false - @VisibleForTesting - var brightnessMirrorSpring = DepthAnimation() - var brightnessMirrorVisible: Boolean = false - set(value) { - field = value - brightnessMirrorSpring.animateTo(if (value) blurUtils.blurRadiusOfRatio(1f) - else 0) - } - var qsPanelExpansion = 0f set(value) { if (field == value) return @@ -169,7 +160,6 @@ class NotificationShadeDepthController @Inject constructor( normalizedBlurRadius * ANIMATION_BLUR_FRACTION).toInt() combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(qsPanelExpansion)) var shadeRadius = max(combinedBlur, wakeAndUnlockBlurRadius).toFloat() - shadeRadius *= 1f - brightnessMirrorSpring.ratio val launchProgress = notificationLaunchAnimationParams?.linearProgress ?: 0f shadeRadius *= (1f - launchProgress) * (1f - launchProgress) @@ -263,7 +253,6 @@ class NotificationShadeDepthController @Inject constructor( shadeSpring.finishIfRunning() shadeAnimation.finishIfRunning() globalActionsSpring.finishIfRunning() - brightnessMirrorSpring.finishIfRunning() } } @@ -425,7 +414,6 @@ class NotificationShadeDepthController @Inject constructor( it.println("shadeRadius: ${shadeSpring.radius}") it.println("shadeAnimation: ${shadeAnimation.radius}") it.println("globalActionsRadius: ${globalActionsSpring.radius}") - it.println("brightnessMirrorRadius: ${brightnessMirrorSpring.radius}") it.println("wakeAndUnlockBlur: $wakeAndUnlockBlurRadius") it.println("notificationLaunchAnimationProgress: " + "${notificationLaunchAnimationParams?.linearProgress}") diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java index a0edc7c494bc..399c8500ab48 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java @@ -74,13 +74,11 @@ public class BrightnessMirrorController mBrightnessMirror.setVisibility(View.VISIBLE); mVisibilityCallback.accept(true); mNotificationPanel.setPanelAlpha(0, true /* animate */); - mDepthController.setBrightnessMirrorVisible(true); } public void hideMirror() { mVisibilityCallback.accept(false); mNotificationPanel.setPanelAlpha(255, true /* animate */); - mDepthController.setBrightnessMirrorVisible(false); } /** diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt index 45a7d0a54155..a0c3ed992115 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt @@ -69,7 +69,6 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { @Mock private lateinit var shadeSpring: NotificationShadeDepthController.DepthAnimation @Mock private lateinit var shadeAnimation: NotificationShadeDepthController.DepthAnimation @Mock private lateinit var globalActionsSpring: NotificationShadeDepthController.DepthAnimation - @Mock private lateinit var brightnessSpring: NotificationShadeDepthController.DepthAnimation @Mock private lateinit var listener: NotificationShadeDepthController.DepthListener @Mock private lateinit var dozeParameters: DozeParameters @JvmField @Rule val mockitoRule = MockitoJUnit.rule() @@ -97,7 +96,6 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { notificationShadeWindowController, dozeParameters, dumpManager) notificationShadeDepthController.shadeSpring = shadeSpring notificationShadeDepthController.shadeAnimation = shadeAnimation - notificationShadeDepthController.brightnessMirrorSpring = brightnessSpring notificationShadeDepthController.globalActionsSpring = globalActionsSpring notificationShadeDepthController.root = root @@ -245,31 +243,6 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { } @Test - fun brightnessMirrorVisible_whenVisible() { - notificationShadeDepthController.brightnessMirrorVisible = true - verify(brightnessSpring).animateTo(eq(maxBlur), any()) - } - - @Test - fun brightnessMirrorVisible_whenHidden() { - notificationShadeDepthController.brightnessMirrorVisible = false - verify(brightnessSpring).animateTo(eq(0), any()) - } - - @Test - fun brightnessMirror_hidesShadeBlur() { - // Brightness mirror is fully visible - `when`(brightnessSpring.ratio).thenReturn(1f) - // And shade is blurred - `when`(shadeSpring.radius).thenReturn(maxBlur) - `when`(shadeAnimation.radius).thenReturn(maxBlur) - - notificationShadeDepthController.updateBlurCallback.doFrame(0) - verify(notificationShadeWindowController).setBackgroundBlurRadius(0) - verify(blurUtils).applyBlur(eq(viewRootImpl), eq(0)) - } - - @Test fun setNotificationLaunchAnimationParams_schedulesFrame() { val animProgress = ExpandAnimationParameters() animProgress.linearProgress = 0.5f |