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

Commit e64b75ec authored by John Spurlock's avatar John Spurlock Committed by Android (Google) Code Review
Browse files

Merge "Zen: tweak audience interruption logic." into lmp-dev

parents 09f6e614 528dcd2f
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;
    }