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

Commit 7dbe23da authored by Matt Pietal's avatar Matt Pietal
Browse files

Remove clock migration: the last one

Final traces of the flag

Bug: 301502635
Test: atest SystemUITests
Flag: EXEMPT flag cleanup
Change-Id: I4f71971ef800640f6ea831fcc10323ce2c1fedb5
parent 1f73b12d
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -546,14 +546,6 @@ flag {
   bug: "305049544"
}

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"
+0 −4
Original line number Diff line number Diff line
@@ -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()

+0 −53
Original line number Diff line number Diff line
/*
 * 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)
}
+3 −16
Original line number Diff line number Diff line
@@ -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
@@ -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)
    }
}
+0 −3
Original line number Diff line number Diff line
@@ -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
Loading