Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -1326,7 +1326,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } }); mScreenOffAnimationController.initialize(this, mLightRevealScrim); mScreenOffAnimationController.initialize(this, mShadeSurface, mLightRevealScrim); updateLightRevealScrimVisibility(); mShadeSurface.initDependencies( Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ScreenOffAnimationController.kt +12 −3 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.statusbar.phone import android.view.View import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.WakefulnessLifecycle import com.android.systemui.shade.ShadeViewController import com.android.systemui.statusbar.LightRevealScrim import com.android.systemui.unfold.FoldAodAnimationController import com.android.systemui.unfold.SysUIUnfoldComponent Loading @@ -37,8 +38,12 @@ class ScreenOffAnimationController @Inject constructor( private val animations: List<ScreenOffAnimation> = listOfNotNull(foldToAodAnimation, unlockedScreenOffAnimation) fun initialize(centralSurfaces: CentralSurfaces, lightRevealScrim: LightRevealScrim) { animations.forEach { it.initialize(centralSurfaces, lightRevealScrim) } fun initialize( centralSurfaces: CentralSurfaces, shadeViewController: ShadeViewController, lightRevealScrim: LightRevealScrim, ) { animations.forEach { it.initialize(centralSurfaces, shadeViewController, lightRevealScrim) } wakefulnessLifecycle.addObserver(this) } Loading Loading @@ -197,7 +202,11 @@ class ScreenOffAnimationController @Inject constructor( } interface ScreenOffAnimation { fun initialize(centralSurfaces: CentralSurfaces, lightRevealScrim: LightRevealScrim) {} fun initialize( centralSurfaces: CentralSurfaces, shadeViewController: ShadeViewController, lightRevealScrim: LightRevealScrim, ) {} /** * Called when started going to sleep, should return true if the animation will be played Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt +12 −8 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.app.animation.Interpolators import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.KeyguardViewMediator import com.android.systemui.keyguard.WakefulnessLifecycle import com.android.systemui.shade.ShadeViewController import com.android.systemui.statusbar.CircleReveal import com.android.systemui.statusbar.LightRevealScrim import com.android.systemui.statusbar.NotificationShadeWindowController Loading Loading @@ -66,7 +67,8 @@ class UnlockedScreenOffAnimationController @Inject constructor( private val powerManager: PowerManager, private val handler: Handler = Handler() ) : WakefulnessLifecycle.Observer, ScreenOffAnimation { private lateinit var mCentralSurfaces: CentralSurfaces private lateinit var centralSurfaces: CentralSurfaces private lateinit var shadeViewController: ShadeViewController /** * Whether or not [initialize] has been called to provide us with the StatusBar, * NotificationPanelViewController, and LightRevealSrim so that we can run the unlocked screen Loading Loading @@ -126,7 +128,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( lightRevealAnimator.start() } val animatorDurationScaleObserver = object : ContentObserver(null) { private val animatorDurationScaleObserver = object : ContentObserver(null) { override fun onChange(selfChange: Boolean) { updateAnimatorDurationScale() } Loading @@ -134,11 +136,13 @@ class UnlockedScreenOffAnimationController @Inject constructor( override fun initialize( centralSurfaces: CentralSurfaces, shadeViewController: ShadeViewController, lightRevealScrim: LightRevealScrim ) { this.initialized = true this.lightRevealScrim = lightRevealScrim this.mCentralSurfaces = centralSurfaces this.centralSurfaces = centralSurfaces this.shadeViewController = shadeViewController updateAnimatorDurationScale() globalSettings.registerContentObserver( Loading Loading @@ -198,7 +202,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( // Tell the CentralSurfaces to become keyguard for real - we waited on that // since it is slow and would have caused the animation to jank. mCentralSurfaces.updateIsKeyguard() centralSurfaces.updateIsKeyguard() // Run the callback given to us by the KeyguardVisibilityHelper. after.run() Loading Loading @@ -251,7 +255,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( // even if we're going from SHADE to SHADE or KEYGUARD to KEYGUARD, since we might have // changed parts of the UI (such as showing AOD in the shade) without actually changing // the StatusBarState. This ensures that the UI definitely reflects the desired state. mCentralSurfaces.updateIsKeyguard(true /* forceStateChange */) centralSurfaces.updateIsKeyguard(true /* forceStateChange */) } } Loading Loading @@ -280,7 +284,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( // Show AOD. That'll cause the KeyguardVisibilityHelper to call // #animateInKeyguard. mCentralSurfaces.shadeViewController.showAodUi() shadeViewController.showAodUi() } }, (ANIMATE_IN_KEYGUARD_DELAY * animatorDurationScale).toLong()) Loading Loading @@ -328,8 +332,8 @@ class UnlockedScreenOffAnimationController @Inject constructor( // We currently draw both the light reveal scrim, and the AOD UI, in the shade. If it's // already expanded and showing notifications/QS, the animation looks really messy. For now, // disable it if the notification panel is expanded. if ((!this::mCentralSurfaces.isInitialized || mCentralSurfaces.shadeViewController.isPanelExpanded) && if ((!this::centralSurfaces.isInitialized || shadeViewController.isPanelExpanded) && // Status bar might be expanded because we have started // playing the animation already !isAnimationPlaying() Loading packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt +9 −4 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.systemui.keyguard.WakefulnessLifecycle import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.shade.ShadeFoldAnimator import com.android.systemui.shade.ShadeViewController import com.android.systemui.statusbar.LightRevealScrim import com.android.systemui.statusbar.phone.CentralSurfaces import com.android.systemui.statusbar.phone.ScreenOffAnimation Loading Loading @@ -62,7 +63,7 @@ constructor( private val keyguardInteractor: Lazy<KeyguardInteractor>, ) : CallbackController<FoldAodAnimationStatus>, ScreenOffAnimation, WakefulnessLifecycle.Observer { private lateinit var centralSurfaces: CentralSurfaces private lateinit var shadeViewController: ShadeViewController private var isFolded = false private var isFoldHandled = true Loading @@ -87,8 +88,12 @@ constructor( ) } override fun initialize(centralSurfaces: CentralSurfaces, lightRevealScrim: LightRevealScrim) { this.centralSurfaces = centralSurfaces override fun initialize( centralSurfaces: CentralSurfaces, shadeViewController: ShadeViewController, lightRevealScrim: LightRevealScrim, ) { this.shadeViewController = shadeViewController deviceStateManager.registerCallback(mainExecutor, FoldListener()) wakefulnessLifecycle.addObserver(this) Loading Loading @@ -128,7 +133,7 @@ constructor( } private fun getShadeFoldAnimator(): ShadeFoldAnimator = centralSurfaces.shadeViewController.shadeFoldAnimator shadeViewController.shadeFoldAnimator private fun setAnimationState(playing: Boolean) { shouldPlayAnimation = playing Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationControllerTest.kt +1 −3 Original line number Diff line number Diff line Loading @@ -97,9 +97,7 @@ class UnlockedScreenOffAnimationControllerTest : SysuiTestCase() { powerManager, handler = handler ) controller.initialize(centralSurfaces, lightRevealScrim) `when`(centralSurfaces.shadeViewController).thenReturn( shadeViewController) controller.initialize(centralSurfaces, shadeViewController, lightRevealScrim) // Screen off does not run if the panel is expanded, so we should say it's collapsed to test // screen off. Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -1326,7 +1326,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } }); mScreenOffAnimationController.initialize(this, mLightRevealScrim); mScreenOffAnimationController.initialize(this, mShadeSurface, mLightRevealScrim); updateLightRevealScrimVisibility(); mShadeSurface.initDependencies( Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScreenOffAnimationController.kt +12 −3 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.statusbar.phone import android.view.View import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.WakefulnessLifecycle import com.android.systemui.shade.ShadeViewController import com.android.systemui.statusbar.LightRevealScrim import com.android.systemui.unfold.FoldAodAnimationController import com.android.systemui.unfold.SysUIUnfoldComponent Loading @@ -37,8 +38,12 @@ class ScreenOffAnimationController @Inject constructor( private val animations: List<ScreenOffAnimation> = listOfNotNull(foldToAodAnimation, unlockedScreenOffAnimation) fun initialize(centralSurfaces: CentralSurfaces, lightRevealScrim: LightRevealScrim) { animations.forEach { it.initialize(centralSurfaces, lightRevealScrim) } fun initialize( centralSurfaces: CentralSurfaces, shadeViewController: ShadeViewController, lightRevealScrim: LightRevealScrim, ) { animations.forEach { it.initialize(centralSurfaces, shadeViewController, lightRevealScrim) } wakefulnessLifecycle.addObserver(this) } Loading Loading @@ -197,7 +202,11 @@ class ScreenOffAnimationController @Inject constructor( } interface ScreenOffAnimation { fun initialize(centralSurfaces: CentralSurfaces, lightRevealScrim: LightRevealScrim) {} fun initialize( centralSurfaces: CentralSurfaces, shadeViewController: ShadeViewController, lightRevealScrim: LightRevealScrim, ) {} /** * Called when started going to sleep, should return true if the animation will be played Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt +12 −8 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.app.animation.Interpolators import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.KeyguardViewMediator import com.android.systemui.keyguard.WakefulnessLifecycle import com.android.systemui.shade.ShadeViewController import com.android.systemui.statusbar.CircleReveal import com.android.systemui.statusbar.LightRevealScrim import com.android.systemui.statusbar.NotificationShadeWindowController Loading Loading @@ -66,7 +67,8 @@ class UnlockedScreenOffAnimationController @Inject constructor( private val powerManager: PowerManager, private val handler: Handler = Handler() ) : WakefulnessLifecycle.Observer, ScreenOffAnimation { private lateinit var mCentralSurfaces: CentralSurfaces private lateinit var centralSurfaces: CentralSurfaces private lateinit var shadeViewController: ShadeViewController /** * Whether or not [initialize] has been called to provide us with the StatusBar, * NotificationPanelViewController, and LightRevealSrim so that we can run the unlocked screen Loading Loading @@ -126,7 +128,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( lightRevealAnimator.start() } val animatorDurationScaleObserver = object : ContentObserver(null) { private val animatorDurationScaleObserver = object : ContentObserver(null) { override fun onChange(selfChange: Boolean) { updateAnimatorDurationScale() } Loading @@ -134,11 +136,13 @@ class UnlockedScreenOffAnimationController @Inject constructor( override fun initialize( centralSurfaces: CentralSurfaces, shadeViewController: ShadeViewController, lightRevealScrim: LightRevealScrim ) { this.initialized = true this.lightRevealScrim = lightRevealScrim this.mCentralSurfaces = centralSurfaces this.centralSurfaces = centralSurfaces this.shadeViewController = shadeViewController updateAnimatorDurationScale() globalSettings.registerContentObserver( Loading Loading @@ -198,7 +202,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( // Tell the CentralSurfaces to become keyguard for real - we waited on that // since it is slow and would have caused the animation to jank. mCentralSurfaces.updateIsKeyguard() centralSurfaces.updateIsKeyguard() // Run the callback given to us by the KeyguardVisibilityHelper. after.run() Loading Loading @@ -251,7 +255,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( // even if we're going from SHADE to SHADE or KEYGUARD to KEYGUARD, since we might have // changed parts of the UI (such as showing AOD in the shade) without actually changing // the StatusBarState. This ensures that the UI definitely reflects the desired state. mCentralSurfaces.updateIsKeyguard(true /* forceStateChange */) centralSurfaces.updateIsKeyguard(true /* forceStateChange */) } } Loading Loading @@ -280,7 +284,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( // Show AOD. That'll cause the KeyguardVisibilityHelper to call // #animateInKeyguard. mCentralSurfaces.shadeViewController.showAodUi() shadeViewController.showAodUi() } }, (ANIMATE_IN_KEYGUARD_DELAY * animatorDurationScale).toLong()) Loading Loading @@ -328,8 +332,8 @@ class UnlockedScreenOffAnimationController @Inject constructor( // We currently draw both the light reveal scrim, and the AOD UI, in the shade. If it's // already expanded and showing notifications/QS, the animation looks really messy. For now, // disable it if the notification panel is expanded. if ((!this::mCentralSurfaces.isInitialized || mCentralSurfaces.shadeViewController.isPanelExpanded) && if ((!this::centralSurfaces.isInitialized || shadeViewController.isPanelExpanded) && // Status bar might be expanded because we have started // playing the animation already !isAnimationPlaying() Loading
packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt +9 −4 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.systemui.keyguard.WakefulnessLifecycle import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.shade.ShadeFoldAnimator import com.android.systemui.shade.ShadeViewController import com.android.systemui.statusbar.LightRevealScrim import com.android.systemui.statusbar.phone.CentralSurfaces import com.android.systemui.statusbar.phone.ScreenOffAnimation Loading Loading @@ -62,7 +63,7 @@ constructor( private val keyguardInteractor: Lazy<KeyguardInteractor>, ) : CallbackController<FoldAodAnimationStatus>, ScreenOffAnimation, WakefulnessLifecycle.Observer { private lateinit var centralSurfaces: CentralSurfaces private lateinit var shadeViewController: ShadeViewController private var isFolded = false private var isFoldHandled = true Loading @@ -87,8 +88,12 @@ constructor( ) } override fun initialize(centralSurfaces: CentralSurfaces, lightRevealScrim: LightRevealScrim) { this.centralSurfaces = centralSurfaces override fun initialize( centralSurfaces: CentralSurfaces, shadeViewController: ShadeViewController, lightRevealScrim: LightRevealScrim, ) { this.shadeViewController = shadeViewController deviceStateManager.registerCallback(mainExecutor, FoldListener()) wakefulnessLifecycle.addObserver(this) Loading Loading @@ -128,7 +133,7 @@ constructor( } private fun getShadeFoldAnimator(): ShadeFoldAnimator = centralSurfaces.shadeViewController.shadeFoldAnimator shadeViewController.shadeFoldAnimator private fun setAnimationState(playing: Boolean) { shouldPlayAnimation = playing Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationControllerTest.kt +1 −3 Original line number Diff line number Diff line Loading @@ -97,9 +97,7 @@ class UnlockedScreenOffAnimationControllerTest : SysuiTestCase() { powerManager, handler = handler ) controller.initialize(centralSurfaces, lightRevealScrim) `when`(centralSurfaces.shadeViewController).thenReturn( shadeViewController) controller.initialize(centralSurfaces, shadeViewController, lightRevealScrim) // Screen off does not run if the panel is expanded, so we should say it's collapsed to test // screen off. Loading