summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-02-04 10:54:05 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2025-02-04 10:54:05 -0800
commit3e5ff90f8eaad1fefdaf2ca2e092ba24c288dc14 (patch)
tree3179063b4e54d2bde102f5bef7e5f21c7aa8158d
parentb2d4779d7ffc3c5882838c26563535c7564289f1 (diff)
parentc4cb8dc06c588db9528788b9956240604e11cfca (diff)
Merge "[Dual Shade] Remove the DualShade flag and remaining references to it." into main
-rw-r--r--packages/SystemUI/aconfig/systemui.aconfig7
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenUserActionsViewModelTest.kt9
-rw-r--r--packages/SystemUI/src/com/android/systemui/flags/FlagDependencies.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeExpandedStateInteractor.kt8
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractor.kt7
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/shared/flag/DualShade.kt56
6 files changed, 9 insertions, 82 deletions
diff --git a/packages/SystemUI/aconfig/systemui.aconfig b/packages/SystemUI/aconfig/systemui.aconfig
index ac53dcb1982a..f4be41eef9d9 100644
--- a/packages/SystemUI/aconfig/systemui.aconfig
+++ b/packages/SystemUI/aconfig/systemui.aconfig
@@ -282,13 +282,6 @@ flag {
}
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"
description: "Refactoring device entry UDFPS icon to use modern architecture and "
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenUserActionsViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenUserActionsViewModelTest.kt
index 57c65b4ac8e9..cf8123764928 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenUserActionsViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenUserActionsViewModelTest.kt
@@ -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 =
diff --git a/packages/SystemUI/src/com/android/systemui/flags/FlagDependencies.kt b/packages/SystemUI/src/com/android/systemui/flags/FlagDependencies.kt
index 200a751cf825..ebe228dab05a 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/FlagDependencies.kt
+++ b/packages/SystemUI/src/com/android/systemui/flags/FlagDependencies.kt
@@ -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
diff --git a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeExpandedStateInteractor.kt b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeExpandedStateInteractor.kt
index aba5a6bceb10..8b110e3ef792 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeExpandedStateInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeExpandedStateInteractor.kt
@@ -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. */
@@ -99,7 +97,7 @@ private suspend fun StateFlow<Float>.waitUntil(f: Float, coroutineContext: Corou
?: Log.e(
"ShadeExpStateInteractor",
"Timed out after ${EXPAND_COLLAPSE_TIMEOUT.inWholeMilliseconds}ms while waiting " +
- "for expansion to match $f. Current one: $value",
+ "for expansion to match $f. Current one: $value",
)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractor.kt b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractor.kt
index 01451502b859..8f4e8701cad8 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractor.kt
@@ -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
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/shared/flag/DualShade.kt b/packages/SystemUI/src/com/android/systemui/shade/shared/flag/DualShade.kt
deleted file mode 100644
index 4db40582def4..000000000000
--- a/packages/SystemUI/src/com/android/systemui/shade/shared/flag/DualShade.kt
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.shade.shared.flag
-
-import com.android.systemui.Flags
-import com.android.systemui.flags.FlagToken
-import com.android.systemui.flags.RefactorFlagUtils
-
-/** Helper for reading and using the Dual Shade feature flag. */
-object DualShade {
-
- /** The aconfig flag name. */
- const val FLAG_NAME = Flags.FLAG_DUAL_SHADE
-
- /** The flag description -- not an aconfig flag name. */
- const val DESCRIPTION = "DualShadeFlag"
-
- /** A token used for dependency declaration. */
- val token: FlagToken
- get() = FlagToken(FLAG_NAME, isEnabled)
-
- /** Whether the feature is enabled. */
- @JvmStatic
- inline val isEnabled
- get() = Flags.dualShade()
-
- /**
- * Called to ensure code is only run when the flag is enabled. This protects users from the
- * unintended behaviors caused by accidentally running new logic, while also crashing on an eng
- * build to ensure that the refactor author catches issues in testing.
- */
- @JvmStatic
- fun isUnexpectedlyInLegacyMode() =
- RefactorFlagUtils.isUnexpectedlyInLegacyMode(isEnabled, DESCRIPTION)
-
- /**
- * Called to ensure code is only run when the flag is disabled. This will throw an exception if
- * the flag is enabled to ensure that the refactor author catches issues in testing.
- */
- @JvmStatic
- fun assertInLegacyMode() = RefactorFlagUtils.assertInLegacyMode(isEnabled, DESCRIPTION)
-}