summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2014-08-15 14:05:47 -0400
committerJohn Spurlock <jspurlock@google.com>2014-08-15 14:05:47 -0400
commit528dcd2fbe6556ca542a432b7aa26731663e3148 (patch)
treeb6d18c4094b3a60331aaa4811bbd3c5717cfdd00
parent4db0d98b42a723f2e16c6595e85e866fd26c6d98 (diff)
downloadframeworks_base-528dcd2fbe6556ca542a432b7aa26731663e3148.zip
frameworks_base-528dcd2fbe6556ca542a432b7aa26731663e3148.tar.gz
frameworks_base-528dcd2fbe6556ca542a432b7aa26731663e3148.tar.bz2
Zen: tweak audience interruption logic.
Only check audience for calls & messages. Bug:17061146 Change-Id: I7f0176a7184c725fef393784fe8ccb0eb7f49ff7
-rw-r--r--services/core/java/com/android/server/notification/ZenModeHelper.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/notification/ZenModeHelper.java b/services/core/java/com/android/server/notification/ZenModeHelper.java
index b7b5f98..758f334 100644
--- a/services/core/java/com/android/server/notification/ZenModeHelper.java
+++ b/services/core/java/com/android/server/notification/ZenModeHelper.java
@@ -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;
}