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 Diff line number Diff line
@@ -16,6 +16,7 @@

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

import android.util.Log
import com.android.systemui.Flags
import com.android.systemui.dagger.SysUISingleton
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.transitions.BlurConfig
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 kotlin.time.Duration.Companion.milliseconds
import kotlinx.coroutines.flow.Flow
@@ -32,8 +37,13 @@ import kotlinx.coroutines.flow.Flow
@SysUISingleton
class PrimaryBouncerToOccludedTransitionViewModel
@Inject
constructor(blurConfig: BlurConfig, animationFlow: KeyguardTransitionAnimationFlow) :
    PrimaryBouncerTransition {
constructor(
    blurConfig: BlurConfig,
    animationFlow: KeyguardTransitionAnimationFlow,
    shadeInteractor: ShadeInteractor,
    shadeModeInteractor: ShadeModeInteractor,
    headsUpManager: HeadsUpManager,
) : PrimaryBouncerTransition {
    private val transitionAnimation =
        animationFlow
            .setup(
@@ -46,7 +56,20 @@ constructor(blurConfig: BlurConfig, animationFlow: KeyguardTransitionAnimationFl
        transitionAnimation.sharedFlowWithShade(
            duration = 1.milliseconds,
            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()) {
                        blurConfig.maxBlurRadiusPx
                    } else {
@@ -60,4 +83,8 @@ constructor(blurConfig: BlurConfig, animationFlow: KeyguardTransitionAnimationFl

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

    companion object {
        private const val TAG = "PrimaryBouncerToOccludedTransitionViewModel"
    }
}
+1 −2
Original line number Diff line number Diff line
@@ -1883,8 +1883,7 @@ public final class NotificationPanelViewController implements
                || expandedHeight > mHeadsUpStartHeight);
        if (goingBetweenClosedShadeAndExpandedQs && qsShouldExpandWithHeadsUp) {
            float qsExpansionFraction;
            if (mSplitShadeEnabled && (SceneContainerFlag.isEnabled()
                    || !Flags.bouncerUiRevamp())) {
            if (mSplitShadeEnabled) {
                qsExpansionFraction = 1;
            } else if (isKeyguardShowing()) {
                // On Keyguard, interpolate the QS expansion linearly to the panel expansion
+6 −0
Original line number 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.kosmos.Kosmos
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 {
    PrimaryBouncerToOccludedTransitionViewModel(
        animationFlow = keyguardTransitionAnimationFlow,
        blurConfig = blurConfig,
        shadeInteractor = shadeInteractor,
        shadeModeInteractor = shadeModeInteractor,
        headsUpManager = headsUpManager,
    )
}