Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +2 −1 Original line number Original line Diff line number Diff line Loading @@ -181,7 +181,8 @@ class NotificationShadeDepthController @Inject constructor( if (shouldApplyShadeBlur()) shadeExpansion else 0f, false)) if (shouldApplyShadeBlur()) shadeExpansion else 0f, false)) var combinedBlur = (expansionRadius * INTERACTION_BLUR_FRACTION + var combinedBlur = (expansionRadius * INTERACTION_BLUR_FRACTION + animationRadius * ANIMATION_BLUR_FRACTION) animationRadius * ANIMATION_BLUR_FRACTION) val qsExpandedRatio = qsPanelExpansion * shadeExpansion val qsExpandedRatio = Interpolators.getNotificationScrimAlpha(qsPanelExpansion, false /* notification */) * shadeExpansion combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(qsExpandedRatio)) combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(qsExpandedRatio)) combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(transitionToFullShadeProgress)) combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(transitionToFullShadeProgress)) var shadeRadius = max(combinedBlur, wakeAndUnlockBlurRadius) var shadeRadius = max(combinedBlur, wakeAndUnlockBlurRadius) Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -587,6 +587,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump if (isNaN(expansionFraction)) { if (isNaN(expansionFraction)) { return; return; } } expansionFraction = Interpolators .getNotificationScrimAlpha(expansionFraction, false /* notification */); boolean qsBottomVisible = qsPanelBottomY > 0; boolean qsBottomVisible = qsPanelBottomY > 0; if (mQsExpansion != expansionFraction || mQsBottomVisible != qsBottomVisible) { if (mQsExpansion != expansionFraction || mQsBottomVisible != qsBottomVisible) { mQsExpansion = expansionFraction; mQsExpansion = expansionFraction; Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +14 −2 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.view.View import android.view.ViewRootImpl import android.view.ViewRootImpl import androidx.test.filters.SmallTest import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.SysuiTestCase import com.android.systemui.animation.Interpolators import com.android.systemui.dump.DumpManager import com.android.systemui.dump.DumpManager import com.android.systemui.plugins.statusbar.StatusBarStateController import com.android.systemui.plugins.statusbar.StatusBarStateController import com.android.systemui.statusbar.phone.BiometricUnlockController import com.android.systemui.statusbar.phone.BiometricUnlockController Loading Loading @@ -178,10 +179,21 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { @Test @Test fun setQsPanelExpansion_appliesBlur() { fun setQsPanelExpansion_appliesBlur() { statusBarState = StatusBarState.KEYGUARD notificationShadeDepthController.qsPanelExpansion = 1f notificationShadeDepthController.qsPanelExpansion = 1f notificationShadeDepthController.onPanelExpansionChanged(0.5f, tracking = false) notificationShadeDepthController.onPanelExpansionChanged(1f, tracking = false) notificationShadeDepthController.updateBlurCallback.doFrame(0) notificationShadeDepthController.updateBlurCallback.doFrame(0) verify(blurUtils).applyBlur(any(), anyInt(), eq(false)) verify(blurUtils).applyBlur(any(), eq(maxBlur), eq(false)) } @Test fun setQsPanelExpansion_easing() { statusBarState = StatusBarState.KEYGUARD notificationShadeDepthController.qsPanelExpansion = 0.25f notificationShadeDepthController.onPanelExpansionChanged(1f, tracking = false) notificationShadeDepthController.updateBlurCallback.doFrame(0) verify(wallpaperManager).setWallpaperZoomOut(any(), eq(Interpolators.getNotificationScrimAlpha(0.25f, false /* notifications */))) } } @Test @Test Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -705,7 +705,7 @@ public class ScrimControllerTest extends SysuiTestCase { public void qsExpansion_half_clippingQs() { public void qsExpansion_half_clippingQs() { reset(mScrimBehind); reset(mScrimBehind); mScrimController.setClipsQsScrim(true); mScrimController.setClipsQsScrim(true); mScrimController.setQsPosition(0.5f, 999 /* value doesn't matter */); mScrimController.setQsPosition(0.25f, 999 /* value doesn't matter */); finishAnimationsImmediately(); finishAnimationsImmediately(); assertScrimAlpha(Map.of( assertScrimAlpha(Map.of( Loading Loading @@ -1136,7 +1136,7 @@ public class ScrimControllerTest extends SysuiTestCase { @Test @Test public void testScrimsVisible_whenShadeVisibleOnLockscreen() { public void testScrimsVisible_whenShadeVisibleOnLockscreen() { mScrimController.transitionTo(ScrimState.KEYGUARD); mScrimController.transitionTo(ScrimState.KEYGUARD); mScrimController.setQsPosition(0.5f, 300); mScrimController.setQsPosition(0.25f, 300); assertScrimAlpha(Map.of( assertScrimAlpha(Map.of( mScrimBehind, SEMI_TRANSPARENT, mScrimBehind, SEMI_TRANSPARENT, Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +2 −1 Original line number Original line Diff line number Diff line Loading @@ -181,7 +181,8 @@ class NotificationShadeDepthController @Inject constructor( if (shouldApplyShadeBlur()) shadeExpansion else 0f, false)) if (shouldApplyShadeBlur()) shadeExpansion else 0f, false)) var combinedBlur = (expansionRadius * INTERACTION_BLUR_FRACTION + var combinedBlur = (expansionRadius * INTERACTION_BLUR_FRACTION + animationRadius * ANIMATION_BLUR_FRACTION) animationRadius * ANIMATION_BLUR_FRACTION) val qsExpandedRatio = qsPanelExpansion * shadeExpansion val qsExpandedRatio = Interpolators.getNotificationScrimAlpha(qsPanelExpansion, false /* notification */) * shadeExpansion combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(qsExpandedRatio)) combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(qsExpandedRatio)) combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(transitionToFullShadeProgress)) combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(transitionToFullShadeProgress)) var shadeRadius = max(combinedBlur, wakeAndUnlockBlurRadius) var shadeRadius = max(combinedBlur, wakeAndUnlockBlurRadius) Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -587,6 +587,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump if (isNaN(expansionFraction)) { if (isNaN(expansionFraction)) { return; return; } } expansionFraction = Interpolators .getNotificationScrimAlpha(expansionFraction, false /* notification */); boolean qsBottomVisible = qsPanelBottomY > 0; boolean qsBottomVisible = qsPanelBottomY > 0; if (mQsExpansion != expansionFraction || mQsBottomVisible != qsBottomVisible) { if (mQsExpansion != expansionFraction || mQsBottomVisible != qsBottomVisible) { mQsExpansion = expansionFraction; mQsExpansion = expansionFraction; Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +14 −2 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.view.View import android.view.ViewRootImpl import android.view.ViewRootImpl import androidx.test.filters.SmallTest import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.SysuiTestCase import com.android.systemui.animation.Interpolators import com.android.systemui.dump.DumpManager import com.android.systemui.dump.DumpManager import com.android.systemui.plugins.statusbar.StatusBarStateController import com.android.systemui.plugins.statusbar.StatusBarStateController import com.android.systemui.statusbar.phone.BiometricUnlockController import com.android.systemui.statusbar.phone.BiometricUnlockController Loading Loading @@ -178,10 +179,21 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { @Test @Test fun setQsPanelExpansion_appliesBlur() { fun setQsPanelExpansion_appliesBlur() { statusBarState = StatusBarState.KEYGUARD notificationShadeDepthController.qsPanelExpansion = 1f notificationShadeDepthController.qsPanelExpansion = 1f notificationShadeDepthController.onPanelExpansionChanged(0.5f, tracking = false) notificationShadeDepthController.onPanelExpansionChanged(1f, tracking = false) notificationShadeDepthController.updateBlurCallback.doFrame(0) notificationShadeDepthController.updateBlurCallback.doFrame(0) verify(blurUtils).applyBlur(any(), anyInt(), eq(false)) verify(blurUtils).applyBlur(any(), eq(maxBlur), eq(false)) } @Test fun setQsPanelExpansion_easing() { statusBarState = StatusBarState.KEYGUARD notificationShadeDepthController.qsPanelExpansion = 0.25f notificationShadeDepthController.onPanelExpansionChanged(1f, tracking = false) notificationShadeDepthController.updateBlurCallback.doFrame(0) verify(wallpaperManager).setWallpaperZoomOut(any(), eq(Interpolators.getNotificationScrimAlpha(0.25f, false /* notifications */))) } } @Test @Test Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -705,7 +705,7 @@ public class ScrimControllerTest extends SysuiTestCase { public void qsExpansion_half_clippingQs() { public void qsExpansion_half_clippingQs() { reset(mScrimBehind); reset(mScrimBehind); mScrimController.setClipsQsScrim(true); mScrimController.setClipsQsScrim(true); mScrimController.setQsPosition(0.5f, 999 /* value doesn't matter */); mScrimController.setQsPosition(0.25f, 999 /* value doesn't matter */); finishAnimationsImmediately(); finishAnimationsImmediately(); assertScrimAlpha(Map.of( assertScrimAlpha(Map.of( Loading Loading @@ -1136,7 +1136,7 @@ public class ScrimControllerTest extends SysuiTestCase { @Test @Test public void testScrimsVisible_whenShadeVisibleOnLockscreen() { public void testScrimsVisible_whenShadeVisibleOnLockscreen() { mScrimController.transitionTo(ScrimState.KEYGUARD); mScrimController.transitionTo(ScrimState.KEYGUARD); mScrimController.setQsPosition(0.5f, 300); mScrimController.setQsPosition(0.25f, 300); assertScrimAlpha(Map.of( assertScrimAlpha(Map.of( mScrimBehind, SEMI_TRANSPARENT, mScrimBehind, SEMI_TRANSPARENT, Loading