Remove NO_HUN_FOR_OLD_WHEN flag

Fixes: 257315550
Test: atest NotificationInterruptStateProviderImplTest
Change-Id: I483a2a6ba627d6c1e1794102fb043c94b8b4cac3
This commit is contained in:
Jeff DeCew
2023-07-07 13:31:53 -04:00
parent 29659a4ae4
commit 005195e210
4 changed files with 6 additions and 40 deletions

View File

@@ -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 =

View File

@@ -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)
}

View File

@@ -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;

View File

@@ -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);
@@ -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);