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

Commit 3e5ff90f authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[Dual Shade] Remove the DualShade flag and remaining references to it." into main

parents b2d4779d c4cb8dc0
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -281,13 +281,6 @@ flag {
    bug: "283121968"
}

flag {
    name: "dual_shade"
    namespace: "systemui"
    description: "Enables Dual Shade (go/dual-shade-design-doc)."
    bug: "337259436"
}

flag {
    name: "device_entry_udfps_refactor"
    namespace: "systemui"
+5 −4
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

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

import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
import android.testing.TestableLooper.RunWithLooper
import androidx.test.filters.SmallTest
@@ -45,6 +44,8 @@ import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.scene.shared.model.TransitionKeys
import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge
import com.android.systemui.shade.data.repository.shadeRepository
import com.android.systemui.shade.domain.interactor.disableDualShade
import com.android.systemui.shade.domain.interactor.enableDualShade
import com.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
import kotlin.math.pow
@@ -173,10 +174,10 @@ class LockscreenUserActionsViewModelTest : SysuiTestCase() {

    @Test
    @EnableFlags(Flags.FLAG_COMMUNAL_HUB)
    @DisableFlags(Flags.FLAG_DUAL_SHADE)
    fun userActions_fullscreenShade() =
        testScope.runTest {
            underTest.activateIn(this)
            kosmos.disableDualShade()
            kosmos.fakeDeviceEntryRepository.setLockscreenEnabled(true)
            kosmos.fakeAuthenticationRepository.setAuthenticationMethod(
                if (canSwipeToEnter) {
@@ -264,7 +265,7 @@ class LockscreenUserActionsViewModelTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_COMMUNAL_HUB, Flags.FLAG_DUAL_SHADE)
    @EnableFlags(Flags.FLAG_COMMUNAL_HUB)
    fun userActions_dualShade() =
        testScope.runTest {
            underTest.activateIn(this)
@@ -277,7 +278,7 @@ class LockscreenUserActionsViewModelTest : SysuiTestCase() {
                }
            )
            sceneInteractor.changeScene(Scenes.Lockscreen, "reason")
            kosmos.shadeRepository.setShadeLayoutWide(!isNarrowScreen)
            kosmos.enableDualShade(wideLayout = !isNarrowScreen)
            kosmos.setCommunalAvailable(isCommunalAvailable)
            kosmos.fakePowerRepository.updateWakefulness(
                rawState =
+0 −4
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import com.android.systemui.Flags.FLAG_COMMUNAL_HUB
import com.android.systemui.Flags.communalHub
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.shade.shared.flag.DualShade
import com.android.systemui.statusbar.notification.collection.SortBySectionTimeFlag
import com.android.systemui.statusbar.notification.emptyshade.shared.ModesEmptyShadeFix
import com.android.systemui.statusbar.notification.interruption.VisualInterruptionRefactor
@@ -58,9 +57,6 @@ class FlagDependencies @Inject constructor(featureFlags: FeatureFlagsClassic, ha

        // SceneContainer dependencies
        SceneContainerFlag.getFlagDependencies().forEach { (alpha, beta) -> alpha dependsOn beta }

        // DualShade dependencies
        DualShade.token dependsOn SceneContainerFlag.getMainAconfigFlag()
    }

    private inline val politeNotifications
+3 −5
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.shade.ShadeTraceLogger.traceWaitForExpansion
import com.android.systemui.shade.domain.interactor.ShadeExpandedStateInteractor.ShadeElement
import com.android.systemui.shade.shared.flag.DualShade
import com.android.systemui.util.kotlin.Utils.Companion.combineState
import javax.inject.Inject
import kotlin.coroutines.CoroutineContext
@@ -40,10 +39,9 @@ import kotlinx.coroutines.withTimeoutOrNull
 * Wrapper around [ShadeInteractor] to facilitate expansion and collapse of Notifications and quick
 * settings.
 *
 * Specifially created to simplify [ShadeDisplaysInteractor] logic.
 * Specifically created to simplify [ShadeDisplaysInteractor] logic.
 *
 * NOTE: with [SceneContainerFlag] or [DualShade] disabled, [currentlyExpandedElement] will always
 * return null!
 * NOTE: with [SceneContainerFlag] disabled, [currentlyExpandedElement] will always return `null`!
 */
interface ShadeExpandedStateInteractor {
    /** Returns the expanded [ShadeElement]. If none is, returns null. */
+1 −6
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import com.android.systemui.log.table.TableLogBuffer
import com.android.systemui.log.table.logDiffsForTable
import com.android.systemui.scene.domain.SceneFrameworkTableLog
import com.android.systemui.shade.data.repository.ShadeRepository
import com.android.systemui.shade.shared.flag.DualShade
import com.android.systemui.shade.shared.model.ShadeMode
import com.android.systemui.shared.settings.data.repository.SecureSettingsRepository
import javax.inject.Inject
@@ -116,11 +115,7 @@ constructor(
        isShadeLayoutWide: Boolean,
    ): ShadeMode {
        return when {
            isDualShadeEnabled ||
                // TODO(b/388793191): This ensures that the dual_shade aconfig flag can also enable
                //  Dual Shade, to avoid breaking unit tests. Remove this once all references to the
                //  flag are removed.
                DualShade.isEnabled -> ShadeMode.Dual
            isDualShadeEnabled -> ShadeMode.Dual
            isShadeLayoutWide -> ShadeMode.Split
            else -> ShadeMode.Single
        }
Loading