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
diff --git a/packages/SystemUI/aconfig/systemui.aconfig b/packages/SystemUI/aconfig/systemui.aconfig
index 7ce8f98..dcca845 100644
--- a/packages/SystemUI/aconfig/systemui.aconfig
+++ b/packages/SystemUI/aconfig/systemui.aconfig
@@ -177,16 +177,9 @@
}
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"
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/NotificationHeadsUpCycling.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/NotificationHeadsUpCycling.kt
index d6c73a9..2dccea6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/NotificationHeadsUpCycling.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/NotificationHeadsUpCycling.kt
@@ -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 @@
* 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()
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/NotificationThrottleHun.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/NotificationThrottleHun.kt
index dd81d42..71f0de0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/NotificationThrottleHun.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/shared/NotificationThrottleHun.kt
@@ -24,7 +24,7 @@
@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 @@
/** 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