From d1b7ff2f0b18fe4b6c6225e760f0c36df2494ffb Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Fri, 3 Jan 2025 19:07:18 +0000 Subject: Speed up lockscreen alpha on AOD->OCCLUDED ... without light migration flag. There was noticeable overlap with the flag off. Fixes: 380187307 Test: manual - observe phone call interruptions with AOD Flag: EXEMPT bugfix Change-Id: I9f51abe4d8c97542a16122931f8a167564872d41 --- .../viewmodel/AodToOccludedTransitionViewModel.kt | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AodToOccludedTransitionViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AodToOccludedTransitionViewModel.kt index 2497defba5a2..d981eeb0989b 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AodToOccludedTransitionViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AodToOccludedTransitionViewModel.kt @@ -17,6 +17,7 @@ package com.android.systemui.keyguard.ui.viewmodel import android.util.MathUtils +import com.android.systemui.Flags.lightRevealMigration import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.domain.interactor.FromAodTransitionInteractor import com.android.systemui.keyguard.shared.model.Edge @@ -32,9 +33,7 @@ import kotlinx.coroutines.flow.Flow @SysUISingleton class AodToOccludedTransitionViewModel @Inject -constructor( - animationFlow: KeyguardTransitionAnimationFlow, -) : DeviceEntryIconTransition { +constructor(animationFlow: KeyguardTransitionAnimationFlow) : DeviceEntryIconTransition { private val transitionAnimation = animationFlow.setup( duration = FromAodTransitionInteractor.TO_OCCLUDED_DURATION, @@ -52,10 +51,20 @@ constructor( var currentAlpha = 0f return transitionAnimation.sharedFlow( duration = 250.milliseconds, - startTime = 100.milliseconds, // Wait for the light reveal to "hit" the LS elements. - onStart = { currentAlpha = viewState.alpha() }, + startTime = + if (lightRevealMigration()) { + 100.milliseconds // Wait for the light reveal to "hit" the LS elements. + } else { + 0.milliseconds + }, + onStart = { + if (lightRevealMigration()) { + currentAlpha = viewState.alpha() + } else { + currentAlpha = 0f + } + }, onStep = { MathUtils.lerp(currentAlpha, 0f, it) }, - onCancel = { 0f }, ) } -- cgit v1.2.3-59-g8ed1b