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

Commit 528dcd2f authored by John Spurlock's avatar John Spurlock
Browse files

Zen: tweak audience interruption logic.

Only check audience for calls & messages.

Bug:17061146
Change-Id: I7f0176a7184c725fef393784fe8ccb0eb7f49ff7
parent 4db0d98b
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -169,24 +169,19 @@ public class ZenModeHelper {
                    return false;
                }
            }
            // audience has veto power over all following rules
            if (!audienceMatches(record)) {
                ZenLog.traceIntercepted(record, "!audienceMatches");
                return true;
            }
            if (isCall(record)) {
                if (!mConfig.allowCalls) {
                    ZenLog.traceIntercepted(record, "!allowCalls");
                    return true;
                }
                return false;
                return shouldInterceptAudience(record);
            }
            if (isMessage(record)) {
                if (!mConfig.allowMessages) {
                    ZenLog.traceIntercepted(record, "!allowMessages");
                    return true;
                }
                return false;
                return shouldInterceptAudience(record);
            }
            ZenLog.traceIntercepted(record, "!allowed");
            return true;
@@ -194,6 +189,14 @@ public class ZenModeHelper {
        return false;
    }

    private boolean shouldInterceptAudience(NotificationRecord record) {
        if (!audienceMatches(record)) {
            ZenLog.traceIntercepted(record, "!audienceMatches");
            return true;
        }
        return false;
    }

    public int getZenMode() {
        return mZenMode;
    }