summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Matt Pietal <mpietal@google.com> 2024-12-19 18:29:18 +0000
committer Matt Pietal <mpietal@google.com> 2024-12-20 13:55:42 +0000
commit7dbe23da8da2918e0d4ecd05eb315e0e58c5adb0 (patch)
treecf7b58de05a226f80ab733edca55cb44bdcf8182
parent1f73b12d5dd4db6ebcad5d444c79ac18cc59e3c3 (diff)
Remove clock migration: the last one
Final traces of the flag Bug: 301502635 Test: atest SystemUITests Flag: EXEMPT flag cleanup Change-Id: I4f71971ef800640f6ea831fcc10323ce2c1fedb5
-rw-r--r--packages/SystemUI/aconfig/systemui.aconfig8
-rw-r--r--packages/SystemUI/src/com/android/systemui/flags/FlagDependencies.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/MigrateClocksToBlueprint.kt53
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardIndicationAreaViewModel.kt19
-rw-r--r--packages/SystemUI/src/com/android/systemui/scene/shared/flag/SceneContainerFlag.kt3
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/flags/EnableSceneContainer.kt2
6 files changed, 3 insertions, 86 deletions
diff --git a/packages/SystemUI/aconfig/systemui.aconfig b/packages/SystemUI/aconfig/systemui.aconfig
index c4ef837f9280..f16b2c888116 100644
--- a/packages/SystemUI/aconfig/systemui.aconfig
+++ b/packages/SystemUI/aconfig/systemui.aconfig
@@ -547,14 +547,6 @@ flag {
}
flag {
- name: "migrate_clocks_to_blueprint"
- namespace: "systemui"
- description: "Move clock related views from KeyguardStatusView to KeyguardRootView, "
- "and use modern architecture for lockscreen clocks"
- bug: "301502635"
-}
-
-flag {
name: "clock_reactive_variants"
namespace: "systemui"
description: "Add reactive variant fonts to some clocks"
diff --git a/packages/SystemUI/src/com/android/systemui/flags/FlagDependencies.kt b/packages/SystemUI/src/com/android/systemui/flags/FlagDependencies.kt
index 3cc184d7ddf4..63ac783ad42b 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/FlagDependencies.kt
+++ b/packages/SystemUI/src/com/android/systemui/flags/FlagDependencies.kt
@@ -31,7 +31,6 @@ import com.android.systemui.Flags.statusBarCallChipNotificationIcon
import com.android.systemui.Flags.statusBarScreenSharingChips
import com.android.systemui.Flags.statusBarUseReposForCallChip
import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.keyguard.MigrateClocksToBlueprint
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.shade.shared.flag.DualShade
import com.android.systemui.statusbar.notification.collection.SortBySectionTimeFlag
@@ -64,9 +63,6 @@ class FlagDependencies @Inject constructor(featureFlags: FeatureFlagsClassic, ha
// SceneContainer dependencies
SceneContainerFlag.getFlagDependencies().forEach { (alpha, beta) -> alpha dependsOn beta }
- // CommunalHub dependencies
- communalHub dependsOn MigrateClocksToBlueprint.token
-
// DualShade dependencies
DualShade.token dependsOn SceneContainerFlag.getMainAconfigFlag()
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/MigrateClocksToBlueprint.kt b/packages/SystemUI/src/com/android/systemui/keyguard/MigrateClocksToBlueprint.kt
deleted file mode 100644
index 5a2943bd00b3..000000000000
--- a/packages/SystemUI/src/com/android/systemui/keyguard/MigrateClocksToBlueprint.kt
+++ /dev/null
@@ -1,53 +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.keyguard
-
-import com.android.systemui.Flags
-import com.android.systemui.flags.FlagToken
-import com.android.systemui.flags.RefactorFlagUtils
-
-/** Helper for reading or using the migrate clocks to blueprint flag. */
-@Suppress("NOTHING_TO_INLINE")
-object MigrateClocksToBlueprint {
- /** The aconfig flag name */
- const val FLAG_NAME = Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT
-
- /** A token used for dependency declaration */
- val token: FlagToken
- get() = FlagToken(FLAG_NAME, isEnabled)
-
- /** Is the refactor enabled */
- @JvmStatic
- inline val isEnabled
- get() = Flags.migrateClocksToBlueprint()
-
- /**
- * 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
- inline fun isUnexpectedlyInLegacyMode() =
- RefactorFlagUtils.isUnexpectedlyInLegacyMode(isEnabled, FLAG_NAME)
-
- /**
- * 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
- inline fun assertInLegacyMode() = RefactorFlagUtils.assertInLegacyMode(isEnabled, FLAG_NAME)
-}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardIndicationAreaViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardIndicationAreaViewModel.kt
index 4663a2b3c20c..3dcc60a98506 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardIndicationAreaViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardIndicationAreaViewModel.kt
@@ -21,7 +21,6 @@ import com.android.systemui.communal.domain.interactor.CommunalSceneInteractor
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.doze.util.BurnInHelperWrapper
-import com.android.systemui.keyguard.MigrateClocksToBlueprint
import com.android.systemui.keyguard.domain.interactor.BurnInInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor
@@ -72,8 +71,8 @@ constructor(
combine(shortcutsCombinedViewModel.startButton, shortcutsCombinedViewModel.endButton) {
startButtonModel,
endButtonModel ->
- startButtonModel.isVisible || endButtonModel.isVisible
- }
+ startButtonModel.isVisible || endButtonModel.isVisible
+ }
.distinctUntilChanged()
@OptIn(ExperimentalCoroutinesApi::class)
@@ -101,18 +100,6 @@ constructor(
/** Returns an observable for the y-offset by which the indication area should be translated. */
fun indicationAreaTranslationY(defaultBurnInOffset: Int): Flow<Float> {
- return if (MigrateClocksToBlueprint.isEnabled) {
- burnIn.map { it.translationY.toFloat() }.flowOn(mainDispatcher)
- } else {
- keyguardInteractor.dozeAmount
- .map { dozeAmount ->
- dozeAmount *
- (burnInHelperWrapper.burnInOffset(
- /* amplitude = */ defaultBurnInOffset * 2,
- /* xAxis= */ false,
- ) - defaultBurnInOffset)
- }
- .distinctUntilChanged()
- }
+ return burnIn.map { it.translationY.toFloat() }.flowOn(mainDispatcher)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/scene/shared/flag/SceneContainerFlag.kt b/packages/SystemUI/src/com/android/systemui/scene/shared/flag/SceneContainerFlag.kt
index 33bffc2e35ab..dc0c4dc0b01c 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/shared/flag/SceneContainerFlag.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/shared/flag/SceneContainerFlag.kt
@@ -23,7 +23,6 @@ import com.android.systemui.Flags.sceneContainer
import com.android.systemui.flags.FlagToken
import com.android.systemui.flags.RefactorFlagUtils
import com.android.systemui.keyguard.KeyguardWmStateRefactor
-import com.android.systemui.keyguard.MigrateClocksToBlueprint
import com.android.systemui.statusbar.notification.shared.NotificationThrottleHun
import com.android.systemui.statusbar.phone.PredictiveBackSysUiFlag
@@ -37,7 +36,6 @@ object SceneContainerFlag {
get() =
sceneContainer() && // mainAconfigFlag
KeyguardWmStateRefactor.isEnabled &&
- MigrateClocksToBlueprint.isEnabled &&
NotificationThrottleHun.isEnabled &&
PredictiveBackSysUiFlag.isEnabled
@@ -50,7 +48,6 @@ object SceneContainerFlag {
inline fun getSecondaryFlags(): Sequence<FlagToken> =
sequenceOf(
KeyguardWmStateRefactor.token,
- MigrateClocksToBlueprint.token,
NotificationThrottleHun.token,
PredictiveBackSysUiFlag.token,
// NOTE: Changes should also be made in isEnabled and @EnableSceneContainer
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/flags/EnableSceneContainer.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/flags/EnableSceneContainer.kt
index 4513cc086513..dad85697ef1d 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/flags/EnableSceneContainer.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/flags/EnableSceneContainer.kt
@@ -18,7 +18,6 @@ package com.android.systemui.flags
import android.platform.test.annotations.EnableFlags
import com.android.systemui.Flags.FLAG_KEYGUARD_WM_STATE_REFACTOR
-import com.android.systemui.Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT
import com.android.systemui.Flags.FLAG_NOTIFICATION_AVALANCHE_THROTTLE_HUN
import com.android.systemui.Flags.FLAG_PREDICTIVE_BACK_SYSUI
import com.android.systemui.Flags.FLAG_SCENE_CONTAINER
@@ -29,7 +28,6 @@ import com.android.systemui.Flags.FLAG_SCENE_CONTAINER
*/
@EnableFlags(
FLAG_KEYGUARD_WM_STATE_REFACTOR,
- FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT,
FLAG_NOTIFICATION_AVALANCHE_THROTTLE_HUN,
FLAG_PREDICTIVE_BACK_SYSUI,
FLAG_SCENE_CONTAINER,