Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b04b4ad9 authored by Beverly's avatar Beverly Committed by Beverly Tai
Browse files

Call `maybeHandlePendingLock` when GONE => AOD is finished

When the `migrate_clocks_to_blueprint` flag isn't enabled,
`maybeHandlePendingLock` is called after the keyguard is animated.

However, with the flag enabled, animateKeyguardIn is no longer called
(instead animations are directly handled by the transition view models).
Therefore, let's make sure the keyguard state is still updated to showing
once the animation from GONE => AOD is finished by calling
`maybeHandlePendingLock` when the GONE => AOD animation is finished.

Note: if the animation gets cancelled, this path is handled by
logic in `KeyguardViewMediator#onStartedWakingUp` (like when the flag is
not enabled).

Test: manually check isKeyguardShowing state on AOD
Fixes: 329642162
Flag: ACONFIG com.android.systemui.migrate_clocks_to_blueprint TEAMFOOD
Change-Id: I90d3c31faeb4ab82cee998976298cc456732379d
parent 15dae8dc
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@ import com.android.systemui.common.ui.ConfigurationState
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryHapticsInteractor
import com.android.systemui.deviceentry.shared.DeviceEntryUdfpsRefactor
import com.android.systemui.flags.FeatureFlagsClassic
import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor
import com.android.systemui.keyguard.shared.ComposeLockscreen
import com.android.systemui.keyguard.shared.model.LockscreenSceneBlueprint
@@ -52,7 +51,6 @@ import com.android.systemui.keyguard.ui.composable.blueprint.ComposableLockscree
import com.android.systemui.keyguard.ui.view.KeyguardIndicationArea
import com.android.systemui.keyguard.ui.view.KeyguardRootView
import com.android.systemui.keyguard.ui.view.layout.KeyguardBlueprintCommandListener
import com.android.systemui.keyguard.ui.viewmodel.AodAlphaViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardBlueprintViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardIndicationAreaViewModel
@@ -84,7 +82,6 @@ constructor(
    private val keyguardRootViewModel: KeyguardRootViewModel,
    private val keyguardIndicationAreaViewModel: KeyguardIndicationAreaViewModel,
    private val notificationShadeWindowView: NotificationShadeWindowView,
    private val featureFlags: FeatureFlagsClassic,
    private val indicationController: KeyguardIndicationController,
    private val screenOffAnimationController: ScreenOffAnimationController,
    private val occludingAppDeviceEntryMessageViewModel: OccludingAppDeviceEntryMessageViewModel,
@@ -101,13 +98,13 @@ constructor(
    private val deviceEntryHapticsInteractor: DeviceEntryHapticsInteractor,
    private val vibratorHelper: VibratorHelper,
    private val falsingManager: FalsingManager,
    private val aodAlphaViewModel: AodAlphaViewModel,
    private val keyguardClockViewModel: KeyguardClockViewModel,
    private val smartspaceViewModel: KeyguardSmartspaceViewModel,
    private val lockscreenContentViewModel: LockscreenContentViewModel,
    private val lockscreenSceneBlueprintsLazy: Lazy<Set<LockscreenSceneBlueprint>>,
    private val keyguardBlueprintViewBinder: KeyguardBlueprintViewBinder,
    private val clockInteractor: KeyguardClockInteractor,
    private val keyguardViewMediator: KeyguardViewMediator,
) : CoreStartable {

    private var rootViewHandle: DisposableHandle? = null
@@ -209,6 +206,7 @@ constructor(
                deviceEntryHapticsInteractor,
                vibratorHelper,
                falsingManager,
                keyguardViewMediator,
            )
    }

+7 −1
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import com.android.systemui.common.ui.ConfigurationState
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryHapticsInteractor
import com.android.systemui.deviceentry.shared.DeviceEntryUdfpsRefactor
import com.android.systemui.keyguard.KeyguardBottomAreaRefactor
import com.android.systemui.keyguard.KeyguardViewMediator
import com.android.systemui.keyguard.MigrateClocksToBlueprint
import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.keyguard.shared.model.TransitionState
@@ -97,6 +98,7 @@ object KeyguardRootViewBinder {
        deviceEntryHapticsInteractor: DeviceEntryHapticsInteractor?,
        vibratorHelper: VibratorHelper?,
        falsingManager: FalsingManager?,
        keyguardViewMediator: KeyguardViewMediator?,
    ): DisposableHandle {
        var onLayoutChangeListener: OnLayoutChange? = null
        val childViews = mutableMapOf<Int, View>()
@@ -298,8 +300,12 @@ object KeyguardRootViewBinder {
                                        }
                                        TransitionState.CANCELED ->
                                            jankMonitor.cancel(CUJ_SCREEN_OFF_SHOW_AOD)
                                        TransitionState.FINISHED ->
                                        TransitionState.FINISHED -> {
                                            if (MigrateClocksToBlueprint.isEnabled) {
                                                keyguardViewMediator?.maybeHandlePendingLock()
                                            }
                                            jankMonitor.end(CUJ_SCREEN_OFF_SHOW_AOD)
                                        }
                                        TransitionState.RUNNING -> Unit
                                    }
                                }
+1 −0
Original line number Diff line number Diff line
@@ -387,6 +387,7 @@ constructor(
                    null, // device entry haptics not required preview mode
                    null, // device entry haptics not required for preview mode
                    null, // falsing manager not required for preview mode
                    null, // keyguard view mediator is not required for preview mode
                )
        }
        rootView.addView(