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

Commit ac8a3743 authored by Jeff DeCew's avatar Jeff DeCew Committed by Android (Google) Code Review
Browse files

Merge "Move avalanche throttling to a new flag to avoid teamfood issues." into main

parents 39afd5d6 df6a22e0
Loading
Loading
Loading
Loading
+1 −8
Original line number Original line Diff line number Diff line
@@ -176,17 +176,10 @@ flag {
    bug: "305984787"
    bug: "305984787"
}
}


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

flag {
flag {
    name: "notification_avalanche_throttle_hun"
    name: "notification_avalanche_throttle_hun"
    namespace: "systemui"
    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"
    bug: "307288824"
}
}


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


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


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


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


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


    /** Is the heads-up cycling animation enabled */
    /** Is the heads-up cycling animation enabled */
    @JvmStatic
    @JvmStatic
    inline val isEnabled
    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 */
    /** Whether to animate the bottom line when transiting from a tall HUN to a short HUN */
    @JvmStatic
    @JvmStatic
@@ -46,13 +44,12 @@ object NotificationHeadsUpCycling {
     * build to ensure that the refactor author catches issues in testing.
     * build to ensure that the refactor author catches issues in testing.
     */
     */
    @JvmStatic
    @JvmStatic
    inline fun isUnexpectedlyInLegacyMode() =
    inline fun isUnexpectedlyInLegacyMode() = NotificationThrottleHun.isUnexpectedlyInLegacyMode()
        RefactorFlagUtils.isUnexpectedlyInLegacyMode(isEnabled, FLAG_NAME)


    /**
    /**
     * Called to ensure code is only run when the flag is disabled. This will throw an exception if
     * 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.
     * the flag is enabled to ensure that the refactor author catches issues in testing.
     */
     */
    @JvmStatic
    @JvmStatic
    inline fun assertInLegacyMode() = RefactorFlagUtils.assertInLegacyMode(isEnabled, FLAG_NAME)
    inline fun assertInLegacyMode() = NotificationThrottleHun.assertInLegacyMode()
}
}
+2 −2
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@ import com.android.systemui.flags.RefactorFlagUtils
@Suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
object NotificationThrottleHun {
object NotificationThrottleHun {
    /** The aconfig flag name */
    /** 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 */
    /** A token used for dependency declaration */
    val token: FlagToken
    val token: FlagToken
@@ -33,7 +33,7 @@ object NotificationThrottleHun {
    /** Is the refactor enabled */
    /** Is the refactor enabled */
    @JvmStatic
    @JvmStatic
    inline val isEnabled
    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
     * Called to ensure code is only run when the flag is enabled. This protects users from the