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

Commit 38e24eff authored by Lyn Han's avatar Lyn Han Committed by Android (Google) Code Review
Browse files

Merge "Delete noisy AvalancheSuppressor logs" into main

parents 87e2ad04 c42ab6a2
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ class AvalancheProvider
@Inject
constructor(
    private val broadcastDispatcher: BroadcastDispatcher,
    private val logger: VisualInterruptionDecisionLogger,
    private val uiEventLogger: UiEventLogger,
) {
    val TAG = "AvalancheProvider"
+0 −4
Original line number Diff line number Diff line
@@ -280,7 +280,6 @@ class AvalancheSuppressor(
    private val uiEventLogger: UiEventLogger,
    private val context: Context,
    private val notificationManager: NotificationManager,
    private val logger: VisualInterruptionDecisionLogger,
    private val systemSettings: SystemSettings,
) : VisualInterruptionFilter(types = setOf(PEEK, PULSE), reason = "avalanche") {
    val TAG = "AvalancheSuppressor"
@@ -358,18 +357,15 @@ class AvalancheSuppressor(

    override fun shouldSuppress(entry: NotificationEntry): Boolean {
        if (!isCooldownEnabled()) {
            logger.logAvalancheAllow("cooldown OFF")
            return false
        }
        val timeSinceAvalancheMs = systemClock.currentTimeMillis() - avalancheProvider.startTime
        val timedOut = timeSinceAvalancheMs >= avalancheProvider.timeoutMs
        if (timedOut) {
            logger.logAvalancheAllow("timedOut! timeSinceAvalancheMs=$timeSinceAvalancheMs")
            return false
        }
        val state = calculateState(entry)
        if (state != State.SUPPRESS) {
            logger.logAvalancheAllow("state=$state")
            return false
        }
        if (shouldShowEdu()) {
+0 −9
Original line number Diff line number Diff line
@@ -94,15 +94,6 @@ constructor(@NotificationInterruptLog val buffer: LogBuffer) {
        )
    }

    fun logAvalancheAllow(info: String) {
        buffer.log(
            TAG,
            INFO,
            { str1 = info },
            { "AvalancheSuppressor: $str1" }
        )
    }

    fun logCooldownSetting(isEnabled: Boolean) {
        buffer.log(
            TAG,
+0 −1
Original line number Diff line number Diff line
@@ -196,7 +196,6 @@ constructor(
                    uiEventLogger,
                    context,
                    notificationManager,
                    logger,
                    systemSettings,
                )
            )
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ class VisualInterruptionDecisionProviderImplTest : VisualInterruptionDecisionPro
    private fun getAvalancheSuppressor() : AvalancheSuppressor {
        return AvalancheSuppressor(
            avalancheProvider, systemClock, settingsInteractor, packageManager,
            uiEventLogger, context, notificationManager, logger, systemSettings
            uiEventLogger, context, notificationManager, systemSettings
        )
    }