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

Commit 080f5f9b authored by Lyn's avatar Lyn Committed by Lyn Han
Browse files

Remove stale logs that override actual suppression reason

Fixes: 340877141
Test: adb shell cmd statusbar echo -b NotifInterruptLog:verbose
adb reboot && adb logcat | grep VisualInterruptionDecisionProvider

Change-Id: I08a177a56913b9ddfdafcaf470d1fd66e1385d12
parent ca066bcd
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -241,9 +241,6 @@ class AvalancheSuppressor(
    ) {
    val TAG = "AvalancheSuppressor"

    override var reason: String = "avalanche"
        protected set

    enum class State {
        ALLOW_CONVERSATION_AFTER_AVALANCHE,
        ALLOW_HIGH_PRIORITY_CONVERSATION_ANY_TIME,
@@ -257,19 +254,15 @@ class AvalancheSuppressor(

    override fun shouldSuppress(entry: NotificationEntry): Boolean {
        if (!isCooldownEnabled()) {
            reason = "FALSE avalanche cooldown setting DISABLED"
            return false
        }
        val timeSinceAvalancheMs = systemClock.currentTimeMillis() - avalancheProvider.startTime
        val timedOut = timeSinceAvalancheMs >= avalancheProvider.timeoutMs
        if (timedOut) {
            reason = "FALSE avalanche event TIMED OUT. " +
                    "${timeSinceAvalancheMs/1000} seconds since last avalanche"
            return false
        }
        val state = calculateState(entry)
        if (state != State.SUPPRESS) {
            reason = "FALSE avalanche IN ALLOWLIST: $state"
            return false
        }
        return true