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

Commit d9b3b5c8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove NO_HUN_FOR_OLD_WHEN flag" into udc-qpr-dev am: 656b039a am: deff6858

parents cf97dc3a deff6858
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -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 =
+6 −12
Original line number Diff line number Diff line
@@ -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)
}
+0 −4
Original line number Diff line number Diff line
@@ -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;
+0 −21
Original line number Diff line number Diff line
@@ -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);