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

Commit 691fc849 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov Committed by Android (Google) Code Review
Browse files

Merge "Remove isPromotedOngoing helper method and debug promoted flag." into main

parents 04b02def fb8a50e8
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -521,13 +521,6 @@ flag {
    bug: "367705002"
}

flag {
    name: "debug_live_updates_promote_all"
    namespace: "systemui"
    description: "Promote all notifications to Live Updates (RONs). (For testing/debugging only, do not promote/release!)"
    bug: "404838239"
}

flag {
    name: "compose_bouncer"
    namespace: "systemui"
+5 −13
Original line number Diff line number Diff line
@@ -78,14 +78,14 @@ import com.android.systemui.statusbar.notification.row.shared.NotificationConten
import com.android.systemui.statusbar.notification.row.shared.NotificationRowContentBinderRefactor;
import com.android.systemui.statusbar.notification.shared.NotificationBundleUi;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import kotlinx.coroutines.flow.MutableStateFlow;
import kotlinx.coroutines.flow.StateFlow;
import kotlinx.coroutines.flow.StateFlowKt;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * Represents a notification that the system UI knows about
 *
@@ -852,14 +852,6 @@ public final class NotificationEntry extends ListEntry {
        return false;
    }

    /**
     * Returns whether the NotificationEntry is promoted ongoing.
     */
    @FlaggedApi(Flags.FLAG_API_RICH_ONGOING)
    public boolean isOngoingPromoted() {
        return mSbn.getNotification().isPromotedOngoing();
    }

    /**
     * Returns whether this row is considered blockable (i.e. it's not a system notif
     * or is not in an allowList).
@@ -1102,7 +1094,7 @@ public final class NotificationEntry extends ListEntry {
     */
    @FlaggedApi(Flags.FLAG_API_RICH_ONGOING)
    public boolean isPromotedOngoing() {
        return PromotedNotificationContentModel.isPromotedForStatusBarChip(mSbn.getNotification());
        return mSbn.getNotification().isPromotedOngoing();
    }

    /**
+1 −3
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry
import com.android.systemui.statusbar.notification.promoted.AutomaticPromotionCoordinator.Companion.EXTRA_AUTOMATICALLY_EXTRACTED_SHORT_CRITICAL_TEXT
import com.android.systemui.statusbar.notification.promoted.AutomaticPromotionCoordinator.Companion.EXTRA_WAS_AUTOMATICALLY_PROMOTED
import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModel
import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModel.Companion.isPromotedForStatusBarChip
import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModel.NotifIcon
import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModel.OldProgress
import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModel.Style
@@ -104,8 +103,7 @@ constructor(
            return null
        }

        // The status bar chips rely on this extractor, so take them into account for promotion.
        if (!isPromotedForStatusBarChip(notification)) {
        if (!notification.isPromotedOngoing()) {
            if (LOG_NOT_EXTRACTED) {
                logger.logExtractionSkipped(entry, "isPromotedOngoing returned false")
            }
+0 −15
Original line number Diff line number Diff line
@@ -19,16 +19,13 @@ package com.android.systemui.statusbar.notification.promoted.shared.model
import android.annotation.CurrentTimeMillisLong
import android.annotation.DrawableRes
import android.annotation.ElapsedRealtimeLong
import android.app.Notification
import android.graphics.drawable.Drawable
import androidx.annotation.ColorInt
import com.android.internal.widget.NotificationProgressModel
import com.android.systemui.Flags
import com.android.systemui.statusbar.notification.promoted.PromotedNotificationUi
import com.android.systemui.statusbar.notification.row.ImageResult
import com.android.systemui.statusbar.notification.row.LazyImage
import com.android.systemui.statusbar.notification.row.shared.ImageModel
import com.android.systemui.util.Compile

data class PromotedNotificationContentModels(
    /** The potentially redacted version of the content that will be exposed to the public */
@@ -236,17 +233,5 @@ data class PromotedNotificationContentModel(

    companion object {
        @JvmStatic fun featureFlagEnabled(): Boolean = PromotedNotificationUi.isEnabled

        /**
         * Returns true if the given notification should be considered promoted when deciding
         * whether or not to show the status bar chip UI.
         */
        @JvmStatic
        fun isPromotedForStatusBarChip(notification: Notification): Boolean {
            if (Compile.IS_DEBUG && Flags.debugLiveUpdatesPromoteAll()) {
                return true
            }
            return notification.isPromotedOngoing()
        }
    }
}