diff options
6 files changed, 32 insertions, 67 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt index f6c4a316b211..cb13fcf246cb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt @@ -81,7 +81,6 @@ class NotificationShadeDepthController @Inject constructor( } lateinit var root: View - private var blurRoot: View? = null private var keyguardAnimator: Animator? = null private var notificationAnimator: Animator? = null private var updateScheduled: Boolean = false @@ -235,7 +234,7 @@ class NotificationShadeDepthController @Inject constructor( val opaque = scrimsVisible && !blursDisabledForAppLaunch Trace.traceCounter(Trace.TRACE_TAG_APP, "shade_blur_radius", blur) - blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur, opaque) + blurUtils.applyBlur(root.viewRootImpl, blur, opaque) lastAppliedBlur = blur wallpaperController.setNotificationShadeZoom(zoomOut) listeners.forEach { @@ -271,7 +270,6 @@ class NotificationShadeDepthController @Inject constructor( override fun onAnimationEnd(animation: Animator?) { keyguardAnimator = null wakeAndUnlockBlurRadius = 0f - scheduleUpdate() } }) start() @@ -302,7 +300,6 @@ class NotificationShadeDepthController @Inject constructor( override fun onDozeAmountChanged(linear: Float, eased: Float) { wakeAndUnlockBlurRadius = blurUtils.blurRadiusOfRatio(eased) - scheduleUpdate() } } @@ -439,12 +436,11 @@ class NotificationShadeDepthController @Inject constructor( shadeAnimation.animateTo(blurUtils.blurRadiusOfRatio(targetBlurNormalized).toInt()) } - private fun scheduleUpdate(viewToBlur: View? = null) { + private fun scheduleUpdate() { if (updateScheduled) { return } updateScheduled = true - blurRoot = viewToBlur choreographer.postFrameCallback(updateBlurCallback) } @@ -495,16 +491,11 @@ class NotificationShadeDepthController @Inject constructor( */ private var pendingRadius = -1 - /** - * View on {@link Surface} that wants depth. - */ - private var view: View? = null - private var springAnimation = SpringAnimation(this, object : FloatPropertyCompat<DepthAnimation>("blurRadius") { override fun setValue(rect: DepthAnimation?, value: Float) { radius = value - scheduleUpdate(view) + scheduleUpdate() } override fun getValue(rect: DepthAnimation?): Float { @@ -519,11 +510,10 @@ class NotificationShadeDepthController @Inject constructor( springAnimation.addEndListener { _, _, _, _ -> pendingRadius = -1 } } - fun animateTo(newRadius: Int, viewToBlur: View? = null) { - if (pendingRadius == newRadius && view == viewToBlur) { + fun animateTo(newRadius: Int) { + if (pendingRadius == newRadius) { return } - view = viewToBlur pendingRadius = newRadius springAnimation.animateToFinalPosition(newRadius.toFloat()) } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java index 492c9e1b9bdd..961b43347a9e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java @@ -394,8 +394,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn void fadeKeyguardAfterLaunchTransition(Runnable beforeFading, Runnable endRunnable, Runnable cancelRunnable); - void fadeKeyguardWhilePulsing(); - void animateKeyguardUnoccluding(); void startLaunchTransitionTimeout(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java index 4cc67a0f5e79..7463dac6b5d2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -3005,19 +3005,6 @@ public class CentralSurfacesImpl extends CoreStartable implements } /** - * Fades the content of the Keyguard while we are dozing and makes it invisible when finished - * fading. - */ - @Override - public void fadeKeyguardWhilePulsing() { - mNotificationPanelViewController.fadeOut(0, FADE_KEYGUARD_DURATION_PULSING, - ()-> { - hideKeyguard(); - mStatusBarKeyguardViewManager.onKeyguardFadedAway(); - }).start(); - } - - /** * Plays the animation when an activity that was occluding Keyguard goes away. */ @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java index 0603281fd149..24ce5e98bdd0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java @@ -209,12 +209,8 @@ public final class DozeServiceHost implements DozeHost { void updateDozing() { Assert.isMainThread(); - // When in wake-and-unlock while pulsing, keep dozing state until fully unlocked. - boolean - dozing = - mDozingRequested && mStatusBarStateController.getState() == StatusBarState.KEYGUARD - || mBiometricUnlockControllerLazy.get().getMode() - == BiometricUnlockController.MODE_WAKE_AND_UNLOCK_PULSING; + boolean dozing = + mDozingRequested && mStatusBarStateController.getState() == StatusBarState.KEYGUARD; // When in wake-and-unlock we may not have received a change to StatusBarState // but we still should not be dozing, manually set to false. if (mBiometricUnlockControllerLazy.get().getMode() diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index e106f811574c..985f3cd44808 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -836,30 +836,24 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb }); } else { executeAfterKeyguardGoneAction(); - boolean wakeUnlockPulsing = - mBiometricUnlockController.getMode() == MODE_WAKE_AND_UNLOCK_PULSING; mCentralSurfaces.setKeyguardFadingAway(startTime, delay, fadeoutDuration); mBiometricUnlockController.startKeyguardFadingAway(); hideBouncer(true /* destroyView */); - if (wakeUnlockPulsing) { - mCentralSurfaces.fadeKeyguardWhilePulsing(); + + boolean staying = mStatusBarStateController.leaveOpenOnKeyguardHide(); + if (!staying) { + mNotificationShadeWindowController.setKeyguardFadingAway(true); wakeAndUnlockDejank(); + mCentralSurfaces.hideKeyguard(); + // hide() will happen asynchronously and might arrive after the scrims + // were already hidden, this means that the transition callback won't + // be triggered anymore and StatusBarWindowController will be forever in + // the fadingAway state. + mCentralSurfaces.updateScrimController(); } else { - boolean staying = mStatusBarStateController.leaveOpenOnKeyguardHide(); - if (!staying) { - mNotificationShadeWindowController.setKeyguardFadingAway(true); - wakeAndUnlockDejank(); - mCentralSurfaces.hideKeyguard(); - // hide() will happen asynchronously and might arrive after the scrims - // were already hidden, this means that the transition callback won't - // be triggered anymore and StatusBarWindowController will be forever in - // the fadingAway state. - mCentralSurfaces.updateScrimController(); - } else { - mCentralSurfaces.hideKeyguard(); - mCentralSurfaces.finishKeyguardFadingAway(); - mBiometricUnlockController.finishKeyguardFadingAway(); - } + mCentralSurfaces.hideKeyguard(); + mCentralSurfaces.finishKeyguardFadingAway(); + mBiometricUnlockController.finishKeyguardFadingAway(); } updateStates(); 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 b166b7367b53..6446fb5d8c81 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt @@ -48,7 +48,6 @@ import org.mockito.ArgumentMatchers.floatThat import org.mockito.Captor import org.mockito.Mock import org.mockito.Mockito -import org.mockito.Mockito.`when` import org.mockito.Mockito.any import org.mockito.Mockito.anyFloat import org.mockito.Mockito.anyString @@ -56,6 +55,7 @@ import org.mockito.Mockito.clearInvocations import org.mockito.Mockito.never import org.mockito.Mockito.reset import org.mockito.Mockito.verify +import org.mockito.Mockito.`when` import org.mockito.junit.MockitoJUnit @RunWith(AndroidTestingRunner::class) @@ -139,7 +139,7 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { notificationShadeDepthController.onPanelExpansionChanged( PanelExpansionChangeEvent( fraction = 1f, expanded = true, tracking = false, dragDownPxAmount = 0f)) - verify(shadeAnimation).animateTo(eq(maxBlur), any()) + verify(shadeAnimation).animateTo(eq(maxBlur)) } @Test @@ -147,7 +147,7 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { notificationShadeDepthController.onPanelExpansionChanged( PanelExpansionChangeEvent( fraction = 0.01f, expanded = false, tracking = false, dragDownPxAmount = 0f)) - verify(shadeAnimation).animateTo(eq(maxBlur), any()) + verify(shadeAnimation).animateTo(eq(maxBlur)) } @Test @@ -157,7 +157,7 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { notificationShadeDepthController.onPanelExpansionChanged( PanelExpansionChangeEvent( fraction = 0f, expanded = false, tracking = false, dragDownPxAmount = 0f)) - verify(shadeAnimation).animateTo(eq(0), any()) + verify(shadeAnimation).animateTo(eq(0)) } @Test @@ -168,15 +168,15 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { onPanelExpansionChanged_apliesBlur_ifShade() clearInvocations(shadeAnimation) notificationShadeDepthController.onPanelExpansionChanged(event) - verify(shadeAnimation, never()).animateTo(anyInt(), any()) + verify(shadeAnimation, never()).animateTo(anyInt()) notificationShadeDepthController.onPanelExpansionChanged( event.copy(fraction = 0.9f, tracking = true)) - verify(shadeAnimation, never()).animateTo(anyInt(), any()) + verify(shadeAnimation, never()).animateTo(anyInt()) notificationShadeDepthController.onPanelExpansionChanged( event.copy(fraction = 0.8f, tracking = false)) - verify(shadeAnimation).animateTo(eq(0), any()) + verify(shadeAnimation).animateTo(eq(0)) } @Test @@ -186,7 +186,7 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { notificationShadeDepthController.onPanelExpansionChanged( PanelExpansionChangeEvent( fraction = 0.6f, expanded = true, tracking = true, dragDownPxAmount = 0f)) - verify(shadeAnimation).animateTo(eq(maxBlur), any()) + verify(shadeAnimation).animateTo(eq(maxBlur)) } @Test @@ -212,7 +212,7 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { statusBarState = StatusBarState.KEYGUARD statusBarStateListener.onStateChanged(statusBarState) - verify(shadeAnimation).animateTo(eq(0), any()) + verify(shadeAnimation).animateTo(eq(0)) } @Test @@ -395,13 +395,13 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { @Test fun brightnessMirrorVisible_whenVisible() { notificationShadeDepthController.brightnessMirrorVisible = true - verify(brightnessSpring).animateTo(eq(maxBlur), any()) + verify(brightnessSpring).animateTo(eq(maxBlur)) } @Test fun brightnessMirrorVisible_whenHidden() { notificationShadeDepthController.brightnessMirrorVisible = false - verify(brightnessSpring).animateTo(eq(0), any()) + verify(brightnessSpring).animateTo(eq(0)) } @Test @@ -424,7 +424,7 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { fun ignoreShadeBlurUntilHidden_whennNull_ignoresIfShadeHasNoBlur() { `when`(shadeAnimation.radius).thenReturn(0f) notificationShadeDepthController.blursDisabledForAppLaunch = true - verify(shadeAnimation, never()).animateTo(anyInt(), any()) + verify(shadeAnimation, never()).animateTo(anyInt()) } private fun enableSplitShade() { |