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

Commit df6a22e0 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Move avalanche throttling to a new flag to avoid teamfood issues.

Test: n/a
Flag: com.android.systemui.notification_avalanche_throttle_hun
Bug: 307288824
Change-Id: I9bda5afc0afccc9989e20b36ba5f54b6a7bf13c6
parent e7cf4e23
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -176,17 +176,10 @@ flag {
    bug: "305984787"
}

flag {
    name: "notification_throttle_hun"
    namespace: "systemui"
    description: "During notification avalanche, throttle HUNs showing in fast succession."
    bug: "307288824"
}

flag {
    name: "notification_avalanche_throttle_hun"
    namespace: "systemui"
    description: "(currently unused) During notification avalanche, throttle HUNs showing in fast succession."
    description: "During notification avalanche, throttle HUNs showing in fast succession."
    bug: "307288824"
}

+6 −9
Original line number Diff line number Diff line
@@ -16,24 +16,22 @@

package com.android.systemui.statusbar.notification.shared

import com.android.systemui.Flags
import com.android.systemui.flags.FlagToken
import com.android.systemui.flags.RefactorFlagUtils

/** Helper for reading or using the heads-up cycling flag state. */
@Suppress("NOTHING_TO_INLINE")
object NotificationHeadsUpCycling {
    /** The aconfig flag name - enable this feature when FLAG_NOTIFICATION_THROTTLE_HUN is on. */
    const val FLAG_NAME = Flags.FLAG_NOTIFICATION_THROTTLE_HUN
    /** The aconfig flag name */
    const val FLAG_NAME = NotificationThrottleHun.FLAG_NAME

    /** A token used for dependency declaration */
    val token: FlagToken
        get() = FlagToken(FLAG_NAME, isEnabled)
        get() = NotificationThrottleHun.token

    /** Is the heads-up cycling animation enabled */
    @JvmStatic
    inline val isEnabled
        get() = Flags.notificationThrottleHun()
        get() = NotificationThrottleHun.isEnabled

    /** Whether to animate the bottom line when transiting from a tall HUN to a short HUN */
    @JvmStatic
@@ -46,13 +44,12 @@ object NotificationHeadsUpCycling {
     * build to ensure that the refactor author catches issues in testing.
     */
    @JvmStatic
    inline fun isUnexpectedlyInLegacyMode() =
        RefactorFlagUtils.isUnexpectedlyInLegacyMode(isEnabled, FLAG_NAME)
    inline fun isUnexpectedlyInLegacyMode() = NotificationThrottleHun.isUnexpectedlyInLegacyMode()

    /**
     * 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)
    inline fun assertInLegacyMode() = NotificationThrottleHun.assertInLegacyMode()
}
+2 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import com.android.systemui.flags.RefactorFlagUtils
@Suppress("NOTHING_TO_INLINE")
object NotificationThrottleHun {
    /** The aconfig flag name */
    const val FLAG_NAME = Flags.FLAG_NOTIFICATION_THROTTLE_HUN
    const val FLAG_NAME = Flags.FLAG_NOTIFICATION_AVALANCHE_THROTTLE_HUN

    /** A token used for dependency declaration */
    val token: FlagToken
@@ -33,7 +33,7 @@ object NotificationThrottleHun {
    /** Is the refactor enabled */
    @JvmStatic
    inline val isEnabled
        get() = Flags.notificationThrottleHun()
        get() = Flags.notificationAvalancheThrottleHun()

    /**
     * Called to ensure code is only run when the flag is enabled. This protects users from the