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

Commit c42ab6a2 authored by Lyn Han's avatar Lyn Han
Browse files

Delete noisy AvalancheSuppressor logs

Fixes: 394159274
Test: adb shell cmd statusbar echo -b NotifInterruptLog:verbose
      adb reboot
      adb logcat | grep VisualInterruptionDecisionProvider
Flag: com.android.systemui.notification_avalanche_suppression
Change-Id: I1b5c5e0f069d3cb14283ce9f5192d3c6a3a40266
parent ef93f386
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
        )
    }