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

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

[Dual Shade] Remove the DualShade flag and remaining references to it.

The new way to enable Dual Shade is via the following ADB command:
`adb shell settings put secure dual_shade 1`

(pass 0 to disable.)

To check whether dual shade is enabled via ADB:
`adb shell settings get secure dual_shade`

Fix: 388793191
Test: Unit tests still pass.
Flag: EXEMPT removing com.android.systemui.dual_shade
Change-Id: Iba4ea07f7ce397f21e6b13a5c61f95fdaeb33431
parent 0c147304
Loading
Loading
Loading
Loading
+0 −7
Original line number Original line Diff line number Diff line
@@ -281,13 +281,6 @@ flag {
    bug: "283121968"
    bug: "283121968"
}
}


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

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


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


import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
import android.platform.test.annotations.EnableFlags
import android.testing.TestableLooper.RunWithLooper
import android.testing.TestableLooper.RunWithLooper
import androidx.test.filters.SmallTest
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.shared.model.TransitionKeys
import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge
import com.android.systemui.scene.ui.viewmodel.SceneContainerEdge
import com.android.systemui.shade.data.repository.shadeRepository
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.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertThat
import kotlin.math.pow
import kotlin.math.pow
@@ -173,10 +174,10 @@ class LockscreenUserActionsViewModelTest : SysuiTestCase() {


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


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


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

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


    private inline val politeNotifications
    private inline val politeNotifications
+3 −5
Original line number Original line 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.scene.shared.flag.SceneContainerFlag
import com.android.systemui.shade.ShadeTraceLogger.traceWaitForExpansion
import com.android.systemui.shade.ShadeTraceLogger.traceWaitForExpansion
import com.android.systemui.shade.domain.interactor.ShadeExpandedStateInteractor.ShadeElement
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 com.android.systemui.util.kotlin.Utils.Companion.combineState
import javax.inject.Inject
import javax.inject.Inject
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.CoroutineContext
@@ -40,10 +39,9 @@ import kotlinx.coroutines.withTimeoutOrNull
 * Wrapper around [ShadeInteractor] to facilitate expansion and collapse of Notifications and quick
 * Wrapper around [ShadeInteractor] to facilitate expansion and collapse of Notifications and quick
 * settings.
 * settings.
 *
 *
 * Specifially created to simplify [ShadeDisplaysInteractor] logic.
 * Specifically created to simplify [ShadeDisplaysInteractor] logic.
 *
 *
 * NOTE: with [SceneContainerFlag] or [DualShade] disabled, [currentlyExpandedElement] will always
 * NOTE: with [SceneContainerFlag] disabled, [currentlyExpandedElement] will always return `null`!
 * return null!
 */
 */
interface ShadeExpandedStateInteractor {
interface ShadeExpandedStateInteractor {
    /** Returns the expanded [ShadeElement]. If none is, returns null. */
    /** Returns the expanded [ShadeElement]. If none is, returns null. */
+1 −6
Original line number Original line 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.log.table.logDiffsForTable
import com.android.systemui.scene.domain.SceneFrameworkTableLog
import com.android.systemui.scene.domain.SceneFrameworkTableLog
import com.android.systemui.shade.data.repository.ShadeRepository
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.shade.shared.model.ShadeMode
import com.android.systemui.shared.settings.data.repository.SecureSettingsRepository
import com.android.systemui.shared.settings.data.repository.SecureSettingsRepository
import javax.inject.Inject
import javax.inject.Inject
@@ -116,11 +115,7 @@ constructor(
        isShadeLayoutWide: Boolean,
        isShadeLayoutWide: Boolean,
    ): ShadeMode {
    ): ShadeMode {
        return when {
        return when {
            isDualShadeEnabled ||
            isDualShadeEnabled -> ShadeMode.Dual
                // 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
            isShadeLayoutWide -> ShadeMode.Split
            isShadeLayoutWide -> ShadeMode.Split
            else -> ShadeMode.Single
            else -> ShadeMode.Single
        }
        }
Loading