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

Commit 65d2cf71 authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Do not expand/collapse shade after display move when flexiglass is off

Expanding/collapsing the shade is not supported using ShadeInteractor
for the legacy shade.
This cl removes that behaviour while SceneContainerFlag is off, making
the shade move work also for the legacy shade (and allowing us to turn
on the flag in trunk staging and write e2e tests already)

Bug: 362719719
Test: ShadeExpandedStateInteractorTest
Flag: com.android.systemui.shade_window_goes_around
Change-Id: I2f38f530802c50304bd7d4accf058c591bfa6930
parent 7b27cbe7
Loading
Loading
Loading
Loading
+16 −8
Original line number Diff line number Diff line
@@ -110,15 +110,19 @@ constructor(
    @Background private val bgContext: CoroutineContext,
) : ShadeElement() {
    override suspend fun expand(reason: String) {
        if (SceneContainerFlag.isEnabled) {
            shadeInteractor.expandNotificationsShade(reason)
            shadeInteractor.shadeExpansion.waitUntil(1f, bgContext)
        }
    }

    override suspend fun collapse(reason: String) {
        if (SceneContainerFlag.isEnabled) {
            shadeInteractor.collapseNotificationsShade(reason)
            shadeInteractor.shadeExpansion.waitUntil(0f, bgContext)
        }
    }
}

@SysUISingleton
class QSShadeElement
@@ -128,12 +132,16 @@ constructor(
    @Background private val bgContext: CoroutineContext,
) : ShadeElement() {
    override suspend fun expand(reason: String) {
        if (SceneContainerFlag.isEnabled) {
            shadeInteractor.expandQuickSettingsShade(reason)
            shadeInteractor.qsExpansion.waitUntil(1f, bgContext)
        }
    }

    override suspend fun collapse(reason: String) {
        if (SceneContainerFlag.isEnabled) {
            shadeInteractor.collapseQuickSettingsShade(reason)
            shadeInteractor.qsExpansion.waitUntil(0f, bgContext)
        }
    }
}