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

Commit 36433bb3 authored by burakov's avatar burakov Committed by Danny Burakov
Browse files

[bc25] Fix clock centering logic on Dual Shade.

Since Dual Shade can be in either wide or narrow layout, relying on
ShadeMode to determine the clock centering is insufficient; the screen
width needs to be checked instead.

Flag: com.android.systemui.dual_shade
Flag: com.android.systemui.scene_container
Bug: 338033836
Bug: 352055453
Test: Added unit tests in ag/28236481, and they still pass.
Change-Id: I2bc5ae76d6d1dc8c5d4df9e1c23e3ade78e2af14
parent 5c6056c1
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import com.android.systemui.plugins.clocks.ClockController
import com.android.systemui.plugins.clocks.ClockId
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.shade.shared.model.ShadeMode
import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor
import com.android.systemui.statusbar.notification.domain.interactor.HeadsUpNotificationInteractor
import com.android.systemui.util.kotlin.combine
@@ -104,21 +103,21 @@ constructor(
    val clockShouldBeCentered: Flow<Boolean> =
        if (SceneContainerFlag.isEnabled) {
            combine(
                shadeInteractor.shadeMode,
                shadeInteractor.isShadeLayoutWide,
                activeNotificationsInteractor.areAnyNotificationsPresent,
                keyguardInteractor.isActiveDreamLockscreenHosted,
                isOnAod,
                headsUpNotificationInteractor.isHeadsUpOrAnimatingAway,
                keyguardInteractor.isDozing,
            ) {
                shadeMode,
                isShadeLayoutWide,
                areAnyNotificationsPresent,
                isActiveDreamLockscreenHosted,
                isOnAod,
                isHeadsUp,
                isDozing ->
                when {
                    shadeMode != ShadeMode.Split -> true
                    !isShadeLayoutWide -> true
                    !areAnyNotificationsPresent -> true
                    isActiveDreamLockscreenHosted -> true
                    // Pulsing notification appears on the right. Move clock left to avoid overlap.