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

Commit d0cba47a authored by Chandru S's avatar Chandru S
Browse files

Fix lingering blur issue with HUN with inline reply over occluded app.

Also, reverts earlier fix that introduced QS shade expansion issues.

The root cause is that QS expansion state is incorrect when split shade is enabled.

Flag: EXEMPT bugfix
Test: verified manually
1. Original issue
 a. Lock device that supports split shade
 b. Launch camera over lockscreen
 c. Receive HUN with inline reply action
 d. use inline reply action
 e. go to bouncer to authenticate
 f. go back to camera with pinned HUN over it
 g. camera app is not blurred.

2. QS expansion issue
 a. open launcher in landscape mode (split shade)
 b. the following actions are done without a pointer up event in between them.
 c. pull down shade from top
 d. collapse the shade completely
 e. pull down shade again
 f. both QS and notif shade should be visible.

Fixes: 422653382

Change-Id: Ie39ac067f932039c44ea96c6afb7cfce6c8b19ee
parent ecff86d3
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,
    )
}