summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2015-03-10 20:11:11 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-03-10 20:11:12 +0000
commit0b4db747d3524b3976a40bee22b92591f96abe5d (patch)
tree58656e8b19d92e587cb120b25fd077d94e1fe4e0 /services
parentdbbeeb3f44793798f129f25eb3e62f4cfe709d26 (diff)
parenta70829946265047ef9798829a176978d578a915c (diff)
downloadframeworks_base-0b4db747d3524b3976a40bee22b92591f96abe5d.zip
frameworks_base-0b4db747d3524b3976a40bee22b92591f96abe5d.tar.gz
frameworks_base-0b4db747d3524b3976a40bee22b92591f96abe5d.tar.bz2
Merge "ZenLog: Track changes to effect suppressorship."
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java2
-rw-r--r--services/core/java/com/android/server/notification/ZenLog.java24
2 files changed, 26 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index bedcabe..bb0aa65c 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1026,6 +1026,7 @@ public class NotificationManagerService extends SystemService {
private void updateListenerHintsLocked() {
final int hints = mListenersDisablingEffects.isEmpty() ? 0 : HINT_HOST_DISABLE_EFFECTS;
if (hints == mListenerHints) return;
+ ZenLog.traceListenerHintsChanged(mListenerHints, hints, mListenersDisablingEffects.size());
mListenerHints = hints;
scheduleListenerHintsChanged(hints);
}
@@ -1034,6 +1035,7 @@ public class NotificationManagerService extends SystemService {
final ComponentName suppressor = !mListenersDisablingEffects.isEmpty()
? mListenersDisablingEffects.valueAt(0).component : null;
if (Objects.equals(suppressor, mEffectsSuppressor)) return;
+ ZenLog.traceEffectsSuppressorChanged(mEffectsSuppressor, suppressor);
mEffectsSuppressor = suppressor;
mZenModeHelper.setEffectsSuppressed(suppressor != null);
getContext().sendBroadcast(new Intent(NotificationManager.ACTION_EFFECTS_SUPPRESSOR_CHANGED)
diff --git a/services/core/java/com/android/server/notification/ZenLog.java b/services/core/java/com/android/server/notification/ZenLog.java
index a83fbc3..1fc967f 100644
--- a/services/core/java/com/android/server/notification/ZenLog.java
+++ b/services/core/java/com/android/server/notification/ZenLog.java
@@ -24,6 +24,7 @@ import android.os.RemoteException;
import android.provider.Settings.Global;
import android.service.notification.Condition;
import android.service.notification.IConditionProvider;
+import android.service.notification.NotificationListenerService;
import android.service.notification.ZenModeConfig;
import android.util.Slog;
@@ -56,6 +57,8 @@ public class ZenLog {
private static final int TYPE_CONFIG = 11;
private static final int TYPE_NOT_INTERCEPTED = 12;
private static final int TYPE_DISABLE_EFFECTS = 13;
+ private static final int TYPE_SUPPRESSOR_CHANGED = 14;
+ private static final int TYPE_LISTENER_HINTS_CHANGED = 15;
private static int sNext;
private static int sSize;
@@ -120,6 +123,17 @@ public class ZenLog {
append(TYPE_DISABLE_EFFECTS, record.getKey() + "," + reason);
}
+ public static void traceEffectsSuppressorChanged(ComponentName oldSuppressor,
+ ComponentName newSuppressor) {
+ append(TYPE_SUPPRESSOR_CHANGED, componentToString(oldSuppressor) + "->"
+ + componentToString(newSuppressor));
+ }
+
+ public static void traceListenerHintsChanged(int oldHints, int newHints, int listenerCount) {
+ append(TYPE_LISTENER_HINTS_CHANGED, hintsToString(oldHints) + "->"
+ + hintsToString(newHints) + ",listeners=" + listenerCount);
+ }
+
private static String subscribeResult(IConditionProvider provider, RemoteException e) {
return provider == null ? "no provider" : e != null ? e.getMessage() : "ok";
}
@@ -139,6 +153,8 @@ public class ZenLog {
case TYPE_CONFIG: return "config";
case TYPE_NOT_INTERCEPTED: return "not_intercepted";
case TYPE_DISABLE_EFFECTS: return "disable_effects";
+ case TYPE_SUPPRESSOR_CHANGED: return "suppressor_changed";
+ case TYPE_LISTENER_HINTS_CHANGED: return "listener_hints_changed";
default: return "unknown";
}
}
@@ -161,6 +177,14 @@ public class ZenLog {
}
}
+ private static String hintsToString(int hints) {
+ switch (hints) {
+ case 0 : return "none";
+ case NotificationListenerService.HINT_HOST_DISABLE_EFFECTS : return "disable_effects";
+ default: return Integer.toString(hints);
+ }
+ }
+
private static String componentToString(ComponentName component) {
return component != null ? component.toShortString() : null;
}