Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +12 −0 Original line number Original line Diff line number Diff line Loading @@ -89,6 +89,9 @@ class NotificationShadeDepthController @Inject constructor( private var prevShadeDirection = 0 private var prevShadeDirection = 0 private var prevShadeVelocity = 0f private var prevShadeVelocity = 0f // Only for dumpsys private var lastAppliedBlur = 0 @VisibleForTesting @VisibleForTesting var shadeSpring = DepthAnimation() var shadeSpring = DepthAnimation() var shadeAnimation = DepthAnimation() var shadeAnimation = DepthAnimation() Loading Loading @@ -201,6 +204,7 @@ class NotificationShadeDepthController @Inject constructor( val opaque = scrimsVisible && !blursDisabledForAppLaunch val opaque = scrimsVisible && !blursDisabledForAppLaunch Trace.traceCounter(Trace.TRACE_TAG_APP, "shade_blur_radius", blur) Trace.traceCounter(Trace.TRACE_TAG_APP, "shade_blur_radius", blur) blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur, opaque) blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur, opaque) lastAppliedBlur = blur try { try { if (root.isAttachedToWindow && root.windowToken != null) { if (root.isAttachedToWindow && root.windowToken != null) { wallpaperManager.setWallpaperZoomOut(root.windowToken, zoomOut) wallpaperManager.setWallpaperZoomOut(root.windowToken, zoomOut) Loading Loading @@ -271,6 +275,11 @@ class NotificationShadeDepthController @Inject constructor( brightnessMirrorSpring.finishIfRunning() brightnessMirrorSpring.finishIfRunning() } } } } override fun onDozeAmountChanged(linear: Float, eased: Float) { wakeAndUnlockBlurRadius = blurUtils.blurRadiusOfRatio(eased) scheduleUpdate() } } } init { init { Loading Loading @@ -428,6 +437,9 @@ class NotificationShadeDepthController @Inject constructor( it.println("brightnessMirrorRadius: ${brightnessMirrorSpring.radius}") it.println("brightnessMirrorRadius: ${brightnessMirrorSpring.radius}") it.println("wakeAndUnlockBlur: $wakeAndUnlockBlurRadius") it.println("wakeAndUnlockBlur: $wakeAndUnlockBlurRadius") it.println("blursDisabledForAppLaunch: $blursDisabledForAppLaunch") it.println("blursDisabledForAppLaunch: $blursDisabledForAppLaunch") it.println("qsPanelExpansion: $qsPanelExpansion") it.println("transitionToFullShadeProgress: $transitionToFullShadeProgress") it.println("lastAppliedBlur: $lastAppliedBlur") } } } } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +7 −0 Original line number Original line Diff line number Diff line Loading @@ -195,6 +195,13 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { verify(blurUtils).applyBlur(any(), eq(maxBlur), eq(false)) verify(blurUtils).applyBlur(any(), eq(maxBlur), eq(false)) } } @Test fun onDozeAmountChanged_appliesBlur() { statusBarStateListener.onDozeAmountChanged(1f, 1f) notificationShadeDepthController.updateBlurCallback.doFrame(0) verify(blurUtils).applyBlur(any(), eq(maxBlur), eq(false)) } @Test @Test fun setFullShadeTransition_appliesBlur_onlyIfSupported() { fun setFullShadeTransition_appliesBlur_onlyIfSupported() { reset(blurUtils) reset(blurUtils) Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +12 −0 Original line number Original line Diff line number Diff line Loading @@ -89,6 +89,9 @@ class NotificationShadeDepthController @Inject constructor( private var prevShadeDirection = 0 private var prevShadeDirection = 0 private var prevShadeVelocity = 0f private var prevShadeVelocity = 0f // Only for dumpsys private var lastAppliedBlur = 0 @VisibleForTesting @VisibleForTesting var shadeSpring = DepthAnimation() var shadeSpring = DepthAnimation() var shadeAnimation = DepthAnimation() var shadeAnimation = DepthAnimation() Loading Loading @@ -201,6 +204,7 @@ class NotificationShadeDepthController @Inject constructor( val opaque = scrimsVisible && !blursDisabledForAppLaunch val opaque = scrimsVisible && !blursDisabledForAppLaunch Trace.traceCounter(Trace.TRACE_TAG_APP, "shade_blur_radius", blur) Trace.traceCounter(Trace.TRACE_TAG_APP, "shade_blur_radius", blur) blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur, opaque) blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur, opaque) lastAppliedBlur = blur try { try { if (root.isAttachedToWindow && root.windowToken != null) { if (root.isAttachedToWindow && root.windowToken != null) { wallpaperManager.setWallpaperZoomOut(root.windowToken, zoomOut) wallpaperManager.setWallpaperZoomOut(root.windowToken, zoomOut) Loading Loading @@ -271,6 +275,11 @@ class NotificationShadeDepthController @Inject constructor( brightnessMirrorSpring.finishIfRunning() brightnessMirrorSpring.finishIfRunning() } } } } override fun onDozeAmountChanged(linear: Float, eased: Float) { wakeAndUnlockBlurRadius = blurUtils.blurRadiusOfRatio(eased) scheduleUpdate() } } } init { init { Loading Loading @@ -428,6 +437,9 @@ class NotificationShadeDepthController @Inject constructor( it.println("brightnessMirrorRadius: ${brightnessMirrorSpring.radius}") it.println("brightnessMirrorRadius: ${brightnessMirrorSpring.radius}") it.println("wakeAndUnlockBlur: $wakeAndUnlockBlurRadius") it.println("wakeAndUnlockBlur: $wakeAndUnlockBlurRadius") it.println("blursDisabledForAppLaunch: $blursDisabledForAppLaunch") it.println("blursDisabledForAppLaunch: $blursDisabledForAppLaunch") it.println("qsPanelExpansion: $qsPanelExpansion") it.println("transitionToFullShadeProgress: $transitionToFullShadeProgress") it.println("lastAppliedBlur: $lastAppliedBlur") } } } } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +7 −0 Original line number Original line Diff line number Diff line Loading @@ -195,6 +195,13 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { verify(blurUtils).applyBlur(any(), eq(maxBlur), eq(false)) verify(blurUtils).applyBlur(any(), eq(maxBlur), eq(false)) } } @Test fun onDozeAmountChanged_appliesBlur() { statusBarStateListener.onDozeAmountChanged(1f, 1f) notificationShadeDepthController.updateBlurCallback.doFrame(0) verify(blurUtils).applyBlur(any(), eq(maxBlur), eq(false)) } @Test @Test fun setFullShadeTransition_appliesBlur_onlyIfSupported() { fun setFullShadeTransition_appliesBlur_onlyIfSupported() { reset(blurUtils) reset(blurUtils) Loading