diff options
4 files changed, 6 insertions, 40 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt index d65733f17d33..33d2322b68bd 100644 --- a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt +++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt @@ -68,9 +68,6 @@ object Flags { val NOTIFICATION_MEMORY_LOGGING_ENABLED = unreleasedFlag(119, "notification_memory_logging_enabled") - // TODO(b/257315550): Tracking Bug - val NO_HUN_FOR_OLD_WHEN = releasedFlag(118, "no_hun_for_old_when") - // TODO(b/260335638): Tracking Bug @JvmField val NOTIFICATION_INLINE_REPLY_ANIMATION = diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt index 5f28ecb56b8c..577ad20cb5d4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt @@ -16,27 +16,21 @@ package com.android.systemui.statusbar.notification -import android.content.Context import com.android.internal.config.sysui.SystemUiSystemPropertiesFlags.FlagResolver import com.android.internal.config.sysui.SystemUiSystemPropertiesFlags.NotificationFlags import com.android.systemui.flags.FeatureFlags import com.android.systemui.flags.Flags import javax.inject.Inject -class NotifPipelineFlags @Inject constructor( - val context: Context, - val featureFlags: FeatureFlags, - val sysPropFlags: FlagResolver, +class NotifPipelineFlags +@Inject +constructor( + private val featureFlags: FeatureFlags, + private val sysPropFlags: FlagResolver, ) { fun isDevLoggingEnabled(): Boolean = featureFlags.isEnabled(Flags.NOTIFICATION_PIPELINE_DEVELOPER_LOGGING) fun allowDismissOngoing(): Boolean = - sysPropFlags.isEnabled(NotificationFlags.ALLOW_DISMISS_ONGOING) - - fun isOtpRedactionEnabled(): Boolean = - sysPropFlags.isEnabled(NotificationFlags.OTP_REDACTION) - - val isNoHunForOldWhenEnabled: Boolean - get() = featureFlags.isEnabled(Flags.NO_HUN_FOR_OLD_WHEN) + sysPropFlags.isEnabled(NotificationFlags.ALLOW_DISMISS_ONGOING) } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java index 609f9d47a983..0c43da066fdb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java @@ -582,10 +582,6 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter } private boolean shouldSuppressHeadsUpWhenAwakeForOldWhen(NotificationEntry entry, boolean log) { - if (!mFlags.isNoHunForOldWhenEnabled()) { - return false; - } - final Notification notification = entry.getSbn().getNotification(); if (notification == null) { return false; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java index d3e5816cd1d4..daa45db6b90c 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java @@ -426,23 +426,8 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { } @Test - public void testShouldHeadsUp_oldWhen_flagDisabled() throws Exception { - ensureStateForHeadsUpWhenAwake(); - when(mFlags.isNoHunForOldWhenEnabled()).thenReturn(false); - - NotificationEntry entry = createNotification(IMPORTANCE_HIGH); - entry.getSbn().getNotification().when = makeWhenHoursAgo(25); - - assertThat(mNotifInterruptionStateProvider.shouldHeadsUp(entry)).isTrue(); - - verify(mLogger, never()).logNoHeadsUpOldWhen(any(), anyLong(), anyLong()); - verify(mLogger, never()).logMaybeHeadsUpDespiteOldWhen(any(), anyLong(), anyLong(), any()); - } - - @Test public void testShouldHeadsUp_oldWhen_whenNow() throws Exception { ensureStateForHeadsUpWhenAwake(); - when(mFlags.isNoHunForOldWhenEnabled()).thenReturn(true); NotificationEntry entry = createNotification(IMPORTANCE_HIGH); @@ -455,7 +440,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { @Test public void testShouldHeadsUp_oldWhen_whenRecent() throws Exception { ensureStateForHeadsUpWhenAwake(); - when(mFlags.isNoHunForOldWhenEnabled()).thenReturn(true); NotificationEntry entry = createNotification(IMPORTANCE_HIGH); entry.getSbn().getNotification().when = makeWhenHoursAgo(13); @@ -469,7 +453,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { @Test public void testShouldHeadsUp_oldWhen_whenZero() throws Exception { ensureStateForHeadsUpWhenAwake(); - when(mFlags.isNoHunForOldWhenEnabled()).thenReturn(true); NotificationEntry entry = createNotification(IMPORTANCE_HIGH); entry.getSbn().getNotification().when = 0L; @@ -484,7 +467,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { @Test public void testShouldHeadsUp_oldWhen_whenNegative() throws Exception { ensureStateForHeadsUpWhenAwake(); - when(mFlags.isNoHunForOldWhenEnabled()).thenReturn(true); NotificationEntry entry = createNotification(IMPORTANCE_HIGH); entry.getSbn().getNotification().when = -1L; @@ -498,7 +480,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { @Test public void testShouldHeadsUp_oldWhen_hasFullScreenIntent() throws Exception { ensureStateForHeadsUpWhenAwake(); - when(mFlags.isNoHunForOldWhenEnabled()).thenReturn(true); long when = makeWhenHoursAgo(25); NotificationEntry entry = createFsiNotification(IMPORTANCE_HIGH, /* silent= */ false); @@ -514,7 +495,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { @Test public void testShouldHeadsUp_oldWhen_isForegroundService() throws Exception { ensureStateForHeadsUpWhenAwake(); - when(mFlags.isNoHunForOldWhenEnabled()).thenReturn(true); long when = makeWhenHoursAgo(25); NotificationEntry entry = createFgsNotification(IMPORTANCE_HIGH); @@ -530,7 +510,6 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { @Test public void testShouldNotHeadsUp_oldWhen() throws Exception { ensureStateForHeadsUpWhenAwake(); - when(mFlags.isNoHunForOldWhenEnabled()).thenReturn(true); long when = makeWhenHoursAgo(25); NotificationEntry entry = createNotification(IMPORTANCE_HIGH); |