Loading packages/SystemUI/src/com/android/systemui/flags/Flags.kt +0 −3 Original line number Diff line number Diff line Loading @@ -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 = Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt +6 −12 Original line number Diff line number Diff line Loading @@ -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) } packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java +0 −4 Original line number Diff line number Diff line Loading @@ -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; Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java +0 −21 Original line number Diff line number Diff line Loading @@ -425,24 +425,9 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { return System.currentTimeMillis() - (1000 * 60 * 60 * hoursAgo); } @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); Loading @@ -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); Loading @@ -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; Loading @@ -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; Loading @@ -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); Loading @@ -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); Loading @@ -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); Loading Loading
packages/SystemUI/src/com/android/systemui/flags/Flags.kt +0 −3 Original line number Diff line number Diff line Loading @@ -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 = Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt +6 −12 Original line number Diff line number Diff line Loading @@ -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) }
packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java +0 −4 Original line number Diff line number Diff line Loading @@ -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; Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java +0 −21 Original line number Diff line number Diff line Loading @@ -425,24 +425,9 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { return System.currentTimeMillis() - (1000 * 60 * 60 * hoursAgo); } @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); Loading @@ -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); Loading @@ -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; Loading @@ -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; Loading @@ -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); Loading @@ -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); Loading @@ -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); Loading