summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2014-08-15 18:16:13 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-15 05:27:16 +0000
commite64b75ecd318dcbea9afcde3e72b4cb864710530 (patch)
treec35b4a30bb5adeac4b6823452a28e31821058bbe
parent09f6e61489c49cf45b3aa1947d4acb3a9e375d0f (diff)
parent528dcd2fbe6556ca542a432b7aa26731663e3148 (diff)
downloadframeworks_base-e64b75ecd318dcbea9afcde3e72b4cb864710530.zip
frameworks_base-e64b75ecd318dcbea9afcde3e72b4cb864710530.tar.gz
frameworks_base-e64b75ecd318dcbea9afcde3e72b4cb864710530.tar.bz2
Merge "Zen: tweak audience interruption logic." into lmp-dev
-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;
}