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

Commit bd3fea96 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix lingering blur issue with HUN with inline reply over occluded app." into main

parents 7371be6d d0cba47a
Loading
Loading
Loading
Loading
+30 −3
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package com.android.systemui.keyguard.ui.viewmodel
package com.android.systemui.keyguard.ui.viewmodel


import android.util.Log
import com.android.systemui.Flags
import com.android.systemui.Flags
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.keyguard.domain.interactor.FromPrimaryBouncerTransitionInteractor
import com.android.systemui.keyguard.domain.interactor.FromPrimaryBouncerTransitionInteractor
@@ -25,6 +26,10 @@ import com.android.systemui.keyguard.shared.model.KeyguardState.PRIMARY_BOUNCER
import com.android.systemui.keyguard.ui.KeyguardTransitionAnimationFlow
import com.android.systemui.keyguard.ui.KeyguardTransitionAnimationFlow
import com.android.systemui.keyguard.ui.transitions.BlurConfig
import com.android.systemui.keyguard.ui.transitions.BlurConfig
import com.android.systemui.keyguard.ui.transitions.PrimaryBouncerTransition
import com.android.systemui.keyguard.ui.transitions.PrimaryBouncerTransition
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.shade.domain.interactor.ShadeModeInteractor
import com.android.systemui.statusbar.notification.headsup.HeadsUpManager
import javax.inject.Inject
import javax.inject.Inject
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Duration.Companion.milliseconds
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.Flow
@@ -32,8 +37,13 @@ import kotlinx.coroutines.flow.Flow
@SysUISingleton
@SysUISingleton
class PrimaryBouncerToOccludedTransitionViewModel
class PrimaryBouncerToOccludedTransitionViewModel
@Inject
@Inject
constructor(blurConfig: BlurConfig, animationFlow: KeyguardTransitionAnimationFlow) :
constructor(
    PrimaryBouncerTransition {
    blurConfig: BlurConfig,
    animationFlow: KeyguardTransitionAnimationFlow,
    shadeInteractor: ShadeInteractor,
    shadeModeInteractor: ShadeModeInteractor,
    headsUpManager: HeadsUpManager,
) : PrimaryBouncerTransition {
    private val transitionAnimation =
    private val transitionAnimation =
        animationFlow
        animationFlow
            .setup(
            .setup(
@@ -46,7 +56,20 @@ constructor(blurConfig: BlurConfig, animationFlow: KeyguardTransitionAnimationFl
        transitionAnimation.sharedFlowWithShade(
        transitionAnimation.sharedFlowWithShade(
            duration = 1.milliseconds,
            duration = 1.milliseconds,
            onStep = { step, isShadeExpanded ->
            onStep = { step, isShadeExpanded ->
                if (isShadeExpanded) {
                val isOnlyHeadsUpNotificationShowing =
                    !SceneContainerFlag.isEnabled &&
                        shadeModeInteractor.isSplitShade &&
                        !shadeInteractor.isNotificationsExpanded.value &&
                        shadeInteractor.isQsExpanded.value &&
                        headsUpManager.hasPinnedHeadsUp() &&
                        headsUpManager.hasNotifications()
                if (isOnlyHeadsUpNotificationShowing) {
                    Log.w(
                        TAG,
                        "QsExpansion incorrect with splitShade + a pinned heads-up notification",
                    )
                }
                if (isShadeExpanded && !isOnlyHeadsUpNotificationShowing) {
                    if (Flags.notificationShadeBlur()) {
                    if (Flags.notificationShadeBlur()) {
                        blurConfig.maxBlurRadiusPx
                        blurConfig.maxBlurRadiusPx
                    } else {
                    } else {
@@ -60,4 +83,8 @@ constructor(blurConfig: BlurConfig, animationFlow: KeyguardTransitionAnimationFl


    override val notificationBlurRadius: Flow<Float> =
    override val notificationBlurRadius: Flow<Float> =
        transitionAnimation.immediatelyTransitionTo(0.0f)
        transitionAnimation.immediatelyTransitionTo(0.0f)

    companion object {
        private const val TAG = "PrimaryBouncerToOccludedTransitionViewModel"
    }
}
}
+1 −2
Original line number Original line Diff line number Diff line
@@ -1883,8 +1883,7 @@ public final class NotificationPanelViewController implements
                || expandedHeight > mHeadsUpStartHeight);
                || expandedHeight > mHeadsUpStartHeight);
        if (goingBetweenClosedShadeAndExpandedQs && qsShouldExpandWithHeadsUp) {
        if (goingBetweenClosedShadeAndExpandedQs && qsShouldExpandWithHeadsUp) {
            float qsExpansionFraction;
            float qsExpansionFraction;
            if (mSplitShadeEnabled && (SceneContainerFlag.isEnabled()
            if (mSplitShadeEnabled) {
                    || !Flags.bouncerUiRevamp())) {
                qsExpansionFraction = 1;
                qsExpansionFraction = 1;
            } else if (isKeyguardShowing()) {
            } else if (isKeyguardShowing()) {
                // On Keyguard, interpolate the QS expansion linearly to the panel expansion
                // On Keyguard, interpolate the QS expansion linearly to the panel expansion
+6 −0
Original line number Original line Diff line number Diff line
@@ -20,10 +20,16 @@ import com.android.systemui.keyguard.ui.keyguardTransitionAnimationFlow
import com.android.systemui.keyguard.ui.transitions.blurConfig
import com.android.systemui.keyguard.ui.transitions.blurConfig
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.Kosmos.Fixture
import com.android.systemui.kosmos.Kosmos.Fixture
import com.android.systemui.shade.domain.interactor.shadeInteractor
import com.android.systemui.shade.domain.interactor.shadeModeInteractor
import com.android.systemui.statusbar.notification.headsup.headsUpManager


val Kosmos.primaryBouncerToOccludedTransitionViewModel by Fixture {
val Kosmos.primaryBouncerToOccludedTransitionViewModel by Fixture {
    PrimaryBouncerToOccludedTransitionViewModel(
    PrimaryBouncerToOccludedTransitionViewModel(
        animationFlow = keyguardTransitionAnimationFlow,
        animationFlow = keyguardTransitionAnimationFlow,
        blurConfig = blurConfig,
        blurConfig = blurConfig,
        shadeInteractor = shadeInteractor,
        shadeModeInteractor = shadeModeInteractor,
        headsUpManager = headsUpManager,
    )
    )
}
}