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

Commit 6902100d authored by Steve Elliott's avatar Steve Elliott
Browse files

[flexiglass] Correctly layout notifs on bypass lockscreen

Flag: com.android.systemui.scene_container
Fixes: 359874618
Test: Enable bypass, verify HUNs appear at the top of the screen
Change-Id: I1e70809097f8af104690bd3a316fb86c94a5ce52
parent d0c09925
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -76,6 +76,11 @@ constructor(
            viewModel
                .areNotificationsVisible(contentKey)
                .collectAsStateWithLifecycle(initialValue = false)
        val isBypassEnabled by viewModel.isBypassEnabled.collectAsStateWithLifecycle()

        if (isBypassEnabled) {
            with(notificationSection) { HeadsUpNotifications() }
        }

        LockscreenLongPress(
            viewModel = viewModel.touchHandling,
@@ -110,7 +115,7 @@ constructor(
                                            }
                                )
                            }
                            if (isShadeLayoutWide) {
                            if (isShadeLayoutWide && !isBypassEnabled) {
                                with(notificationSection) {
                                    Notifications(
                                        areNotificationsVisible = areNotificationsVisible,
@@ -124,7 +129,7 @@ constructor(
                                }
                            }
                        }
                        if (!isShadeLayoutWide) {
                        if (!isShadeLayoutWide && !isBypassEnabled) {
                            with(notificationSection) {
                                Notifications(
                                    areNotificationsVisible = areNotificationsVisible,
@@ -175,7 +180,7 @@ constructor(
                },
                modifier = Modifier.fillMaxSize(),
            ) { measurables, constraints ->
                check(measurables.size == 6)
                check(measurables.size == 6) { "Expected 6 measurables, got: ${measurables.size}" }
                val aboveLockIconMeasurable = measurables[0]
                val lockIconMeasurable = measurables[1]
                val belowLockIconMeasurable = measurables[2]
+9 −1
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.view.ViewGroup
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.Dp
@@ -34,6 +33,7 @@ import com.android.systemui.keyguard.ui.viewmodel.AodBurnInViewModel
import com.android.systemui.keyguard.ui.viewmodel.BurnInParameters
import com.android.systemui.lifecycle.rememberViewModel
import com.android.systemui.notifications.ui.composable.ConstrainedNotificationStack
import com.android.systemui.notifications.ui.composable.SnoozeableHeadsUpNotificationSpace
import com.android.systemui.shade.LargeScreenHeaderHelper
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
import com.android.systemui.statusbar.notification.stack.ui.view.NotificationScrollView
@@ -79,6 +79,14 @@ constructor(
        )
    }

    @Composable
    fun SceneScope.HeadsUpNotifications() {
        SnoozeableHeadsUpNotificationSpace(
            stackScrollView = stackScrollView.get(),
            viewModel = rememberViewModel { viewModelFactory.create() },
        )
    }

    /**
     * @param burnInParams params to make this view adaptive to burn-in, `null` to disable burn-in
     *   adjustment
+6 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.res.Resources
import com.android.compose.animation.scene.ContentKey
import com.android.internal.annotations.VisibleForTesting
import com.android.systemui.biometrics.AuthController
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardBlueprintInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor
import com.android.systemui.keyguard.shared.model.ClockSize
@@ -57,6 +58,7 @@ constructor(
    private val shadeInteractor: ShadeInteractor,
    private val unfoldTransitionInteractor: UnfoldTransitionInteractor,
    private val occlusionInteractor: SceneContainerOcclusionInteractor,
    private val deviceEntryInteractor: DeviceEntryInteractor,
) : SysUiViewModel() {
    @VisibleForTesting val clockSize = clockInteractor.clockSize

@@ -73,6 +75,10 @@ constructor(
    /** Whether the content of the scene UI should be shown. */
    val isContentVisible: StateFlow<Boolean> = _isContentVisible.asStateFlow()

    /** @see DeviceEntryInteractor.isBypassEnabled */
    val isBypassEnabled: StateFlow<Boolean>
        get() = deviceEntryInteractor.isBypassEnabled

    override suspend fun onActivated(): Nothing {
        coroutineScope {
            launch {
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.keyguard.ui.viewmodel

import com.android.systemui.biometrics.authController
import com.android.systemui.deviceentry.domain.interactor.deviceEntryInteractor
import com.android.systemui.keyguard.domain.interactor.keyguardBlueprintInteractor
import com.android.systemui.keyguard.domain.interactor.keyguardClockInteractor
import com.android.systemui.kosmos.Kosmos
@@ -34,5 +35,6 @@ val Kosmos.lockscreenContentViewModel by
            shadeInteractor = shadeInteractor,
            unfoldTransitionInteractor = unfoldTransitionInteractor,
            occlusionInteractor = sceneContainerOcclusionInteractor,
            deviceEntryInteractor = deviceEntryInteractor,
        )
    }