Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt +100 −72 Original line number Original line Diff line number Diff line Loading @@ -42,7 +42,9 @@ import javax.inject.Inject import kotlin.math.min import kotlin.math.min @SysUISingleton @SysUISingleton class NotificationWakeUpCoordinator @Inject constructor( class NotificationWakeUpCoordinator @Inject constructor( dumpManager: DumpManager, dumpManager: DumpManager, private val mHeadsUpManager: HeadsUpManager, private val mHeadsUpManager: HeadsUpManager, private val statusBarStateController: StatusBarStateController, private val statusBarStateController: StatusBarStateController, Loading @@ -50,11 +52,14 @@ class NotificationWakeUpCoordinator @Inject constructor( private val dozeParameters: DozeParameters, private val dozeParameters: DozeParameters, private val screenOffAnimationController: ScreenOffAnimationController, private val screenOffAnimationController: ScreenOffAnimationController, private val logger: NotificationWakeUpCoordinatorLogger, private val logger: NotificationWakeUpCoordinatorLogger, ) : OnHeadsUpChangedListener, StatusBarStateController.StateListener, ShadeExpansionListener, ) : OnHeadsUpChangedListener, StatusBarStateController.StateListener, ShadeExpansionListener, Dumpable { Dumpable { private val mNotificationVisibility = object : FloatProperty<NotificationWakeUpCoordinator>( private val mNotificationVisibility = "notificationVisibility") { object : FloatProperty<NotificationWakeUpCoordinator>("notificationVisibility") { override fun setValue(coordinator: NotificationWakeUpCoordinator, value: Float) { override fun setValue(coordinator: NotificationWakeUpCoordinator, value: Float) { coordinator.setVisibilityAmount(value) coordinator.setVisibilityAmount(value) Loading @@ -74,8 +79,7 @@ class NotificationWakeUpCoordinator @Inject constructor( private var hardDozeAmountOverrideSource: String = "n/a" private var hardDozeAmountOverrideSource: String = "n/a" private var outputLinearDozeAmount: Float = 0.0f private var outputLinearDozeAmount: Float = 0.0f private var outputEasedDozeAmount: Float = 0.0f private var outputEasedDozeAmount: Float = 0.0f @VisibleForTesting @VisibleForTesting val dozeAmountInterpolator: Interpolator = Interpolators.FAST_OUT_SLOW_IN val dozeAmountInterpolator: Interpolator = Interpolators.FAST_OUT_SLOW_IN private var mNotificationVisibleAmount = 0.0f private var mNotificationVisibleAmount = 0.0f private var mNotificationsVisible = false private var mNotificationsVisible = false Loading @@ -95,16 +99,21 @@ class NotificationWakeUpCoordinator @Inject constructor( field = value field = value willWakeUp = false willWakeUp = false if (value) { if (value) { if (mNotificationsVisible && !mNotificationsVisibleForExpansion && if ( !bypassController.bypassEnabled) { mNotificationsVisible && !mNotificationsVisibleForExpansion && !bypassController.bypassEnabled ) { // We're waking up while pulsing, let's make sure the animation looks nice // We're waking up while pulsing, let's make sure the animation looks nice mStackScrollerController.wakeUpFromPulse() mStackScrollerController.wakeUpFromPulse() } } if (bypassController.bypassEnabled && !mNotificationsVisible) { if (bypassController.bypassEnabled && !mNotificationsVisible) { // Let's make sure our huns become visible once we are waking up in case // Let's make sure our huns become visible once we are waking up in case // they were blocked by the proximity sensor // they were blocked by the proximity sensor updateNotificationVisibility(animate = shouldAnimateVisibility(), updateNotificationVisibility( increaseSpeed = false) animate = shouldAnimateVisibility(), increaseSpeed = false ) } } } } } } Loading @@ -125,8 +134,10 @@ class NotificationWakeUpCoordinator @Inject constructor( // Only when setting pulsing to true we want an immediate update, since we get // Only when setting pulsing to true we want an immediate update, since we get // this already when the doze service finishes which is usually before we get // this already when the doze service finishes which is usually before we get // the waking up callback // the waking up callback updateNotificationVisibility(animate = shouldAnimateVisibility(), updateNotificationVisibility( increaseSpeed = false) animate = shouldAnimateVisibility(), increaseSpeed = false ) } } } } Loading @@ -140,16 +151,16 @@ class NotificationWakeUpCoordinator @Inject constructor( } } } } /** /** True if we can show pulsing heads up notifications */ * True if we can show pulsing heads up notifications */ var canShowPulsingHuns: Boolean = false var canShowPulsingHuns: Boolean = false private set private set get() { get() { var canShow = pulsing var canShow = pulsing if (bypassController.bypassEnabled) { if (bypassController.bypassEnabled) { // We also allow pulsing on the lock screen! // We also allow pulsing on the lock screen! canShow = canShow || (wakingUp || willWakeUp || fullyAwake) && canShow = canShow || (wakingUp || willWakeUp || fullyAwake) && statusBarStateController.state == StatusBarState.KEYGUARD statusBarStateController.state == StatusBarState.KEYGUARD // We want to hide the notifications when collapsed too much // We want to hide the notifications when collapsed too much if (collapsedEnoughToHide) { if (collapsedEnoughToHide) { Loading @@ -159,7 +170,8 @@ class NotificationWakeUpCoordinator @Inject constructor( return canShow return canShow } } private val bypassStateChangedListener = object : OnBypassStateChangedListener { private val bypassStateChangedListener = object : OnBypassStateChangedListener { override fun onBypassStateChanged(isEnabled: Boolean) { override fun onBypassStateChanged(isEnabled: Boolean) { // When the bypass state changes, we have to check whether we should re-show the // When the bypass state changes, we have to check whether we should re-show the // notifications by clearing the doze amount override which hides them. // notifications by clearing the doze amount override which hides them. Loading @@ -172,17 +184,24 @@ class NotificationWakeUpCoordinator @Inject constructor( mHeadsUpManager.addListener(this) mHeadsUpManager.addListener(this) statusBarStateController.addCallback(this) statusBarStateController.addCallback(this) bypassController.registerOnBypassStateChangedListener(bypassStateChangedListener) bypassController.registerOnBypassStateChangedListener(bypassStateChangedListener) addListener(object : WakeUpListener { addListener( object : WakeUpListener { override fun onFullyHiddenChanged(isFullyHidden: Boolean) { override fun onFullyHiddenChanged(isFullyHidden: Boolean) { if (isFullyHidden && mNotificationsVisibleForExpansion) { if (isFullyHidden && mNotificationsVisibleForExpansion) { // When the notification becomes fully invisible, let's make sure our expansion // When the notification becomes fully invisible, let's make sure our // flag also changes. This can happen if the bouncer shows when dragging down // expansion // flag also changes. This can happen if the bouncer shows when dragging // down // and then the screen turning off, where we don't reset this state. // and then the screen turning off, where we don't reset this state. setNotificationsVisibleForExpansion(visible = false, animate = false, setNotificationsVisibleForExpansion( increaseSpeed = false) visible = false, animate = false, increaseSpeed = false ) } } } } }) } ) } } fun setStackScroller(stackScrollerController: NotificationStackScrollLayoutController) { fun setStackScroller(stackScrollerController: NotificationStackScrollLayoutController) { Loading Loading @@ -228,16 +247,17 @@ class NotificationWakeUpCoordinator @Inject constructor( wakeUpListeners.remove(listener) wakeUpListeners.remove(listener) } } private fun updateNotificationVisibility( private fun updateNotificationVisibility(animate: Boolean, increaseSpeed: Boolean) { animate: Boolean, increaseSpeed: Boolean ) { // TODO: handle Lockscreen wakeup for bypass when we're not pulsing anymore // TODO: handle Lockscreen wakeup for bypass when we're not pulsing anymore var visible = mNotificationsVisibleForExpansion || mHeadsUpManager.hasNotifications() var visible = mNotificationsVisibleForExpansion || mHeadsUpManager.hasNotifications() visible = visible && canShowPulsingHuns visible = visible && canShowPulsingHuns if (!visible && mNotificationsVisible && (wakingUp || willWakeUp) && if ( outputLinearDozeAmount != 0.0f) { !visible && mNotificationsVisible && (wakingUp || willWakeUp) && outputLinearDozeAmount != 0.0f ) { // let's not make notifications invisible while waking up, otherwise the animation // let's not make notifications invisible while waking up, otherwise the animation // is strange // is strange return return Loading Loading @@ -303,8 +323,11 @@ class NotificationWakeUpCoordinator @Inject constructor( val changed = outputLinearDozeAmount != newOutputLinearDozeAmount val changed = outputLinearDozeAmount != newOutputLinearDozeAmount // notify when the animation is starting // notify when the animation is starting if (newOutputLinearDozeAmount != 1.0f && newOutputLinearDozeAmount != 0.0f && if ( (outputLinearDozeAmount == 0.0f || outputLinearDozeAmount == 1.0f)) { newOutputLinearDozeAmount != 1.0f && newOutputLinearDozeAmount != 0.0f && (outputLinearDozeAmount == 0.0f || outputLinearDozeAmount == 1.0f) ) { // Let's notify the scroller that an animation started // Let's notify the scroller that an animation started notifyAnimationStart(outputLinearDozeAmount == 1.0f) notifyAnimationStart(outputLinearDozeAmount == 1.0f) } } Loading @@ -317,13 +340,17 @@ class NotificationWakeUpCoordinator @Inject constructor( hardOverride = hardDozeAmountOverride, hardOverride = hardDozeAmountOverride, outputLinear = outputLinearDozeAmount, outputLinear = outputLinearDozeAmount, state = statusBarStateController.state, state = statusBarStateController.state, changed = changed) changed = changed ) mStackScrollerController.setDozeAmount(outputEasedDozeAmount) mStackScrollerController.setDozeAmount(outputEasedDozeAmount) updateHideAmount() updateHideAmount() if (changed && outputLinearDozeAmount == 0.0f) { if (changed && outputLinearDozeAmount == 0.0f) { setNotificationsVisible(visible = false, animate = false, increaseSpeed = false) setNotificationsVisible(visible = false, animate = false, increaseSpeed = false) setNotificationsVisibleForExpansion(visible = false, animate = false, setNotificationsVisibleForExpansion( increaseSpeed = false) visible = false, animate = false, increaseSpeed = false ) } } } } Loading Loading @@ -351,7 +378,9 @@ class NotificationWakeUpCoordinator @Inject constructor( // the doze amount to 0f (not dozing) so that the notifications are no longer hidden. // the doze amount to 0f (not dozing) so that the notifications are no longer hidden. // See: UnlockedScreenOffAnimationController.onFinishedWakingUp() // See: UnlockedScreenOffAnimationController.onFinishedWakingUp() setHardDozeAmountOverride( setHardDozeAmountOverride( dozing = false, source = "Override: Shade->Shade (lock cancelled by unlock)") dozing = false, source = "Override: Shade->Shade (lock cancelled by unlock)" ) this.state = newState this.state = newState return return } } Loading Loading @@ -425,8 +454,10 @@ class NotificationWakeUpCoordinator @Inject constructor( val willRemove = (!onKeyguard || !dozing) && !bypass && !animating val willRemove = (!onKeyguard || !dozing) && !bypass && !animating logger.logMaybeClearHardDozeAmountOverrideHidingNotifs( logger.logMaybeClearHardDozeAmountOverrideHidingNotifs( willRemove = willRemove, willRemove = willRemove, onKeyguard = onKeyguard, dozing = dozing, onKeyguard = onKeyguard, bypass = bypass, animating = animating, dozing = dozing, bypass = bypass, animating = animating, ) ) if (willRemove) { if (willRemove) { clearHardDozeAmountOverride() clearHardDozeAmountOverride() Loading @@ -453,10 +484,9 @@ class NotificationWakeUpCoordinator @Inject constructor( private fun startVisibilityAnimation(increaseSpeed: Boolean) { private fun startVisibilityAnimation(increaseSpeed: Boolean) { if (mNotificationVisibleAmount == 0f || mNotificationVisibleAmount == 1f) { if (mNotificationVisibleAmount == 0f || mNotificationVisibleAmount == 1f) { mVisibilityInterpolator = if (mNotificationsVisible) mVisibilityInterpolator = Interpolators.TOUCH_RESPONSE if (mNotificationsVisible) Interpolators.TOUCH_RESPONSE else else Interpolators.FAST_OUT_SLOW_IN_REVERSE Interpolators.FAST_OUT_SLOW_IN_REVERSE } } val target = if (mNotificationsVisible) 1.0f else 0.0f val target = if (mNotificationsVisible) 1.0f else 0.0f val visibilityAnimator = ObjectAnimator.ofFloat(this, mNotificationVisibility, target) val visibilityAnimator = ObjectAnimator.ofFloat(this, mNotificationVisibility, target) Loading @@ -472,8 +502,7 @@ class NotificationWakeUpCoordinator @Inject constructor( private fun setVisibilityAmount(visibilityAmount: Float) { private fun setVisibilityAmount(visibilityAmount: Float) { mLinearVisibilityAmount = visibilityAmount mLinearVisibilityAmount = visibilityAmount mVisibilityAmount = mVisibilityInterpolator.getInterpolation( mVisibilityAmount = mVisibilityInterpolator.getInterpolation(visibilityAmount) visibilityAmount) handleAnimationFinished() handleAnimationFinished() updateHideAmount() updateHideAmount() } } Loading Loading @@ -554,13 +583,12 @@ class NotificationWakeUpCoordinator @Inject constructor( } } interface WakeUpListener { interface WakeUpListener { /** /** Called whenever the notifications are fully hidden or shown */ * Called whenever the notifications are fully hidden or shown */ @JvmDefault fun onFullyHiddenChanged(isFullyHidden: Boolean) {} @JvmDefault fun onFullyHiddenChanged(isFullyHidden: Boolean) {} /** /** * Called whenever the pulseExpansion changes * Called whenever the pulseExpansion changes * * @param expandingChanged if the user has started or stopped expanding * @param expandingChanged if the user has started or stopped expanding */ */ @JvmDefault fun onPulseExpansionChanged(expandingChanged: Boolean) {} @JvmDefault fun onPulseExpansionChanged(expandingChanged: Boolean) {} Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt +100 −72 Original line number Original line Diff line number Diff line Loading @@ -42,7 +42,9 @@ import javax.inject.Inject import kotlin.math.min import kotlin.math.min @SysUISingleton @SysUISingleton class NotificationWakeUpCoordinator @Inject constructor( class NotificationWakeUpCoordinator @Inject constructor( dumpManager: DumpManager, dumpManager: DumpManager, private val mHeadsUpManager: HeadsUpManager, private val mHeadsUpManager: HeadsUpManager, private val statusBarStateController: StatusBarStateController, private val statusBarStateController: StatusBarStateController, Loading @@ -50,11 +52,14 @@ class NotificationWakeUpCoordinator @Inject constructor( private val dozeParameters: DozeParameters, private val dozeParameters: DozeParameters, private val screenOffAnimationController: ScreenOffAnimationController, private val screenOffAnimationController: ScreenOffAnimationController, private val logger: NotificationWakeUpCoordinatorLogger, private val logger: NotificationWakeUpCoordinatorLogger, ) : OnHeadsUpChangedListener, StatusBarStateController.StateListener, ShadeExpansionListener, ) : OnHeadsUpChangedListener, StatusBarStateController.StateListener, ShadeExpansionListener, Dumpable { Dumpable { private val mNotificationVisibility = object : FloatProperty<NotificationWakeUpCoordinator>( private val mNotificationVisibility = "notificationVisibility") { object : FloatProperty<NotificationWakeUpCoordinator>("notificationVisibility") { override fun setValue(coordinator: NotificationWakeUpCoordinator, value: Float) { override fun setValue(coordinator: NotificationWakeUpCoordinator, value: Float) { coordinator.setVisibilityAmount(value) coordinator.setVisibilityAmount(value) Loading @@ -74,8 +79,7 @@ class NotificationWakeUpCoordinator @Inject constructor( private var hardDozeAmountOverrideSource: String = "n/a" private var hardDozeAmountOverrideSource: String = "n/a" private var outputLinearDozeAmount: Float = 0.0f private var outputLinearDozeAmount: Float = 0.0f private var outputEasedDozeAmount: Float = 0.0f private var outputEasedDozeAmount: Float = 0.0f @VisibleForTesting @VisibleForTesting val dozeAmountInterpolator: Interpolator = Interpolators.FAST_OUT_SLOW_IN val dozeAmountInterpolator: Interpolator = Interpolators.FAST_OUT_SLOW_IN private var mNotificationVisibleAmount = 0.0f private var mNotificationVisibleAmount = 0.0f private var mNotificationsVisible = false private var mNotificationsVisible = false Loading @@ -95,16 +99,21 @@ class NotificationWakeUpCoordinator @Inject constructor( field = value field = value willWakeUp = false willWakeUp = false if (value) { if (value) { if (mNotificationsVisible && !mNotificationsVisibleForExpansion && if ( !bypassController.bypassEnabled) { mNotificationsVisible && !mNotificationsVisibleForExpansion && !bypassController.bypassEnabled ) { // We're waking up while pulsing, let's make sure the animation looks nice // We're waking up while pulsing, let's make sure the animation looks nice mStackScrollerController.wakeUpFromPulse() mStackScrollerController.wakeUpFromPulse() } } if (bypassController.bypassEnabled && !mNotificationsVisible) { if (bypassController.bypassEnabled && !mNotificationsVisible) { // Let's make sure our huns become visible once we are waking up in case // Let's make sure our huns become visible once we are waking up in case // they were blocked by the proximity sensor // they were blocked by the proximity sensor updateNotificationVisibility(animate = shouldAnimateVisibility(), updateNotificationVisibility( increaseSpeed = false) animate = shouldAnimateVisibility(), increaseSpeed = false ) } } } } } } Loading @@ -125,8 +134,10 @@ class NotificationWakeUpCoordinator @Inject constructor( // Only when setting pulsing to true we want an immediate update, since we get // Only when setting pulsing to true we want an immediate update, since we get // this already when the doze service finishes which is usually before we get // this already when the doze service finishes which is usually before we get // the waking up callback // the waking up callback updateNotificationVisibility(animate = shouldAnimateVisibility(), updateNotificationVisibility( increaseSpeed = false) animate = shouldAnimateVisibility(), increaseSpeed = false ) } } } } Loading @@ -140,16 +151,16 @@ class NotificationWakeUpCoordinator @Inject constructor( } } } } /** /** True if we can show pulsing heads up notifications */ * True if we can show pulsing heads up notifications */ var canShowPulsingHuns: Boolean = false var canShowPulsingHuns: Boolean = false private set private set get() { get() { var canShow = pulsing var canShow = pulsing if (bypassController.bypassEnabled) { if (bypassController.bypassEnabled) { // We also allow pulsing on the lock screen! // We also allow pulsing on the lock screen! canShow = canShow || (wakingUp || willWakeUp || fullyAwake) && canShow = canShow || (wakingUp || willWakeUp || fullyAwake) && statusBarStateController.state == StatusBarState.KEYGUARD statusBarStateController.state == StatusBarState.KEYGUARD // We want to hide the notifications when collapsed too much // We want to hide the notifications when collapsed too much if (collapsedEnoughToHide) { if (collapsedEnoughToHide) { Loading @@ -159,7 +170,8 @@ class NotificationWakeUpCoordinator @Inject constructor( return canShow return canShow } } private val bypassStateChangedListener = object : OnBypassStateChangedListener { private val bypassStateChangedListener = object : OnBypassStateChangedListener { override fun onBypassStateChanged(isEnabled: Boolean) { override fun onBypassStateChanged(isEnabled: Boolean) { // When the bypass state changes, we have to check whether we should re-show the // When the bypass state changes, we have to check whether we should re-show the // notifications by clearing the doze amount override which hides them. // notifications by clearing the doze amount override which hides them. Loading @@ -172,17 +184,24 @@ class NotificationWakeUpCoordinator @Inject constructor( mHeadsUpManager.addListener(this) mHeadsUpManager.addListener(this) statusBarStateController.addCallback(this) statusBarStateController.addCallback(this) bypassController.registerOnBypassStateChangedListener(bypassStateChangedListener) bypassController.registerOnBypassStateChangedListener(bypassStateChangedListener) addListener(object : WakeUpListener { addListener( object : WakeUpListener { override fun onFullyHiddenChanged(isFullyHidden: Boolean) { override fun onFullyHiddenChanged(isFullyHidden: Boolean) { if (isFullyHidden && mNotificationsVisibleForExpansion) { if (isFullyHidden && mNotificationsVisibleForExpansion) { // When the notification becomes fully invisible, let's make sure our expansion // When the notification becomes fully invisible, let's make sure our // flag also changes. This can happen if the bouncer shows when dragging down // expansion // flag also changes. This can happen if the bouncer shows when dragging // down // and then the screen turning off, where we don't reset this state. // and then the screen turning off, where we don't reset this state. setNotificationsVisibleForExpansion(visible = false, animate = false, setNotificationsVisibleForExpansion( increaseSpeed = false) visible = false, animate = false, increaseSpeed = false ) } } } } }) } ) } } fun setStackScroller(stackScrollerController: NotificationStackScrollLayoutController) { fun setStackScroller(stackScrollerController: NotificationStackScrollLayoutController) { Loading Loading @@ -228,16 +247,17 @@ class NotificationWakeUpCoordinator @Inject constructor( wakeUpListeners.remove(listener) wakeUpListeners.remove(listener) } } private fun updateNotificationVisibility( private fun updateNotificationVisibility(animate: Boolean, increaseSpeed: Boolean) { animate: Boolean, increaseSpeed: Boolean ) { // TODO: handle Lockscreen wakeup for bypass when we're not pulsing anymore // TODO: handle Lockscreen wakeup for bypass when we're not pulsing anymore var visible = mNotificationsVisibleForExpansion || mHeadsUpManager.hasNotifications() var visible = mNotificationsVisibleForExpansion || mHeadsUpManager.hasNotifications() visible = visible && canShowPulsingHuns visible = visible && canShowPulsingHuns if (!visible && mNotificationsVisible && (wakingUp || willWakeUp) && if ( outputLinearDozeAmount != 0.0f) { !visible && mNotificationsVisible && (wakingUp || willWakeUp) && outputLinearDozeAmount != 0.0f ) { // let's not make notifications invisible while waking up, otherwise the animation // let's not make notifications invisible while waking up, otherwise the animation // is strange // is strange return return Loading Loading @@ -303,8 +323,11 @@ class NotificationWakeUpCoordinator @Inject constructor( val changed = outputLinearDozeAmount != newOutputLinearDozeAmount val changed = outputLinearDozeAmount != newOutputLinearDozeAmount // notify when the animation is starting // notify when the animation is starting if (newOutputLinearDozeAmount != 1.0f && newOutputLinearDozeAmount != 0.0f && if ( (outputLinearDozeAmount == 0.0f || outputLinearDozeAmount == 1.0f)) { newOutputLinearDozeAmount != 1.0f && newOutputLinearDozeAmount != 0.0f && (outputLinearDozeAmount == 0.0f || outputLinearDozeAmount == 1.0f) ) { // Let's notify the scroller that an animation started // Let's notify the scroller that an animation started notifyAnimationStart(outputLinearDozeAmount == 1.0f) notifyAnimationStart(outputLinearDozeAmount == 1.0f) } } Loading @@ -317,13 +340,17 @@ class NotificationWakeUpCoordinator @Inject constructor( hardOverride = hardDozeAmountOverride, hardOverride = hardDozeAmountOverride, outputLinear = outputLinearDozeAmount, outputLinear = outputLinearDozeAmount, state = statusBarStateController.state, state = statusBarStateController.state, changed = changed) changed = changed ) mStackScrollerController.setDozeAmount(outputEasedDozeAmount) mStackScrollerController.setDozeAmount(outputEasedDozeAmount) updateHideAmount() updateHideAmount() if (changed && outputLinearDozeAmount == 0.0f) { if (changed && outputLinearDozeAmount == 0.0f) { setNotificationsVisible(visible = false, animate = false, increaseSpeed = false) setNotificationsVisible(visible = false, animate = false, increaseSpeed = false) setNotificationsVisibleForExpansion(visible = false, animate = false, setNotificationsVisibleForExpansion( increaseSpeed = false) visible = false, animate = false, increaseSpeed = false ) } } } } Loading Loading @@ -351,7 +378,9 @@ class NotificationWakeUpCoordinator @Inject constructor( // the doze amount to 0f (not dozing) so that the notifications are no longer hidden. // the doze amount to 0f (not dozing) so that the notifications are no longer hidden. // See: UnlockedScreenOffAnimationController.onFinishedWakingUp() // See: UnlockedScreenOffAnimationController.onFinishedWakingUp() setHardDozeAmountOverride( setHardDozeAmountOverride( dozing = false, source = "Override: Shade->Shade (lock cancelled by unlock)") dozing = false, source = "Override: Shade->Shade (lock cancelled by unlock)" ) this.state = newState this.state = newState return return } } Loading Loading @@ -425,8 +454,10 @@ class NotificationWakeUpCoordinator @Inject constructor( val willRemove = (!onKeyguard || !dozing) && !bypass && !animating val willRemove = (!onKeyguard || !dozing) && !bypass && !animating logger.logMaybeClearHardDozeAmountOverrideHidingNotifs( logger.logMaybeClearHardDozeAmountOverrideHidingNotifs( willRemove = willRemove, willRemove = willRemove, onKeyguard = onKeyguard, dozing = dozing, onKeyguard = onKeyguard, bypass = bypass, animating = animating, dozing = dozing, bypass = bypass, animating = animating, ) ) if (willRemove) { if (willRemove) { clearHardDozeAmountOverride() clearHardDozeAmountOverride() Loading @@ -453,10 +484,9 @@ class NotificationWakeUpCoordinator @Inject constructor( private fun startVisibilityAnimation(increaseSpeed: Boolean) { private fun startVisibilityAnimation(increaseSpeed: Boolean) { if (mNotificationVisibleAmount == 0f || mNotificationVisibleAmount == 1f) { if (mNotificationVisibleAmount == 0f || mNotificationVisibleAmount == 1f) { mVisibilityInterpolator = if (mNotificationsVisible) mVisibilityInterpolator = Interpolators.TOUCH_RESPONSE if (mNotificationsVisible) Interpolators.TOUCH_RESPONSE else else Interpolators.FAST_OUT_SLOW_IN_REVERSE Interpolators.FAST_OUT_SLOW_IN_REVERSE } } val target = if (mNotificationsVisible) 1.0f else 0.0f val target = if (mNotificationsVisible) 1.0f else 0.0f val visibilityAnimator = ObjectAnimator.ofFloat(this, mNotificationVisibility, target) val visibilityAnimator = ObjectAnimator.ofFloat(this, mNotificationVisibility, target) Loading @@ -472,8 +502,7 @@ class NotificationWakeUpCoordinator @Inject constructor( private fun setVisibilityAmount(visibilityAmount: Float) { private fun setVisibilityAmount(visibilityAmount: Float) { mLinearVisibilityAmount = visibilityAmount mLinearVisibilityAmount = visibilityAmount mVisibilityAmount = mVisibilityInterpolator.getInterpolation( mVisibilityAmount = mVisibilityInterpolator.getInterpolation(visibilityAmount) visibilityAmount) handleAnimationFinished() handleAnimationFinished() updateHideAmount() updateHideAmount() } } Loading Loading @@ -554,13 +583,12 @@ class NotificationWakeUpCoordinator @Inject constructor( } } interface WakeUpListener { interface WakeUpListener { /** /** Called whenever the notifications are fully hidden or shown */ * Called whenever the notifications are fully hidden or shown */ @JvmDefault fun onFullyHiddenChanged(isFullyHidden: Boolean) {} @JvmDefault fun onFullyHiddenChanged(isFullyHidden: Boolean) {} /** /** * Called whenever the pulseExpansion changes * Called whenever the pulseExpansion changes * * @param expandingChanged if the user has started or stopped expanding * @param expandingChanged if the user has started or stopped expanding */ */ @JvmDefault fun onPulseExpansionChanged(expandingChanged: Boolean) {} @JvmDefault fun onPulseExpansionChanged(expandingChanged: Boolean) {} Loading