summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wren <cwren@android.com>2015-06-16 11:23:12 -0400
committerChris Wren <cwren@android.com>2015-06-16 11:23:12 -0400
commit1a5dad867419e76928c84f0f4fdc4feacce43bbd (patch)
tree99087900e40f441917537628a8e863c1269bbc08
parentb3c8564314a4ce05b722e33409f2c15bcdac6666 (diff)
downloadframeworks_base-1a5dad867419e76928c84f0f4fdc4feacce43bbd.zip
frameworks_base-1a5dad867419e76928c84f0f4fdc4feacce43bbd.tar.gz
frameworks_base-1a5dad867419e76928c84f0f4fdc4feacce43bbd.tar.bz2
disable verbose logs from people notifications.
Bug: 20258744 Change-Id: Ifa3fb4f6aefaab4d6c669b1e60f8536515725c0f
-rw-r--r--services/core/java/com/android/server/notification/ValidateNotificationPeople.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/notification/ValidateNotificationPeople.java b/services/core/java/com/android/server/notification/ValidateNotificationPeople.java
index 10f1696..4af7d4e 100644
--- a/services/core/java/com/android/server/notification/ValidateNotificationPeople.java
+++ b/services/core/java/com/android/server/notification/ValidateNotificationPeople.java
@@ -51,7 +51,7 @@ import java.util.concurrent.TimeUnit;
public class ValidateNotificationPeople implements NotificationSignalExtractor {
// Using a shorter log tag since setprop has a limit of 32chars on variable name.
private static final String TAG = "ValidateNoPeople";
- private static final boolean INFO = true;
+ private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);;
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
private static final boolean ENABLE_PEOPLE_VALIDATOR = true;
@@ -100,7 +100,7 @@ public class ValidateNotificationPeople implements NotificationSignalExtractor {
public void onChange(boolean selfChange, Uri uri, int userId) {
super.onChange(selfChange, uri, userId);
if (DEBUG || mEvictionCount % 100 == 0) {
- if (INFO) Slog.i(TAG, "mEvictionCount: " + mEvictionCount);
+ if (VERBOSE) Slog.i(TAG, "mEvictionCount: " + mEvictionCount);
}
mPeopleCache.evictAll();
mEvictionCount++;
@@ -113,20 +113,20 @@ public class ValidateNotificationPeople implements NotificationSignalExtractor {
public RankingReconsideration process(NotificationRecord record) {
if (!mEnabled) {
- if (INFO) Slog.i(TAG, "disabled");
+ if (VERBOSE) Slog.i(TAG, "disabled");
return null;
}
if (record == null || record.getNotification() == null) {
- if (INFO) Slog.i(TAG, "skipping empty notification");
+ if (VERBOSE) Slog.i(TAG, "skipping empty notification");
return null;
}
if (record.getUserId() == UserHandle.USER_ALL) {
- if (INFO) Slog.i(TAG, "skipping global notification");
+ if (VERBOSE) Slog.i(TAG, "skipping global notification");
return null;
}
Context context = getContextAsUser(record.getUser());
if (context == null) {
- if (INFO) Slog.i(TAG, "skipping notification that lacks a context");
+ if (VERBOSE) Slog.i(TAG, "skipping notification that lacks a context");
return null;
}
return validatePeople(context, record);
@@ -220,7 +220,7 @@ public class ValidateNotificationPeople implements NotificationSignalExtractor {
return null;
}
- if (INFO) Slog.i(TAG, "Validating: " + key + " for " + context.getUserId());
+ if (VERBOSE) Slog.i(TAG, "Validating: " + key + " for " + context.getUserId());
final LinkedList<String> pendingLookups = new LinkedList<String>();
for (int personIdx = 0; personIdx < people.length && personIdx < MAX_PEOPLE; personIdx++) {
final String handle = people[personIdx];
@@ -244,7 +244,7 @@ public class ValidateNotificationPeople implements NotificationSignalExtractor {
affinityOut[0] = affinity;
if (pendingLookups.isEmpty()) {
- if (INFO) Slog.i(TAG, "final affinity: " + affinity);
+ if (VERBOSE) Slog.i(TAG, "final affinity: " + affinity);
if (affinity != NONE) MetricsLogger.count(mBaseContext, "note_with_people", 1);
return null;
}
@@ -422,7 +422,7 @@ public class ValidateNotificationPeople implements NotificationSignalExtractor {
@Override
public void work() {
- if (INFO) Slog.i(TAG, "Executing: validation for: " + mKey);
+ if (VERBOSE) Slog.i(TAG, "Executing: validation for: " + mKey);
long timeStartMs = System.currentTimeMillis();
for (final String handle: mPendingLookups) {
LookupResult lookupResult = null;
@@ -463,7 +463,7 @@ public class ValidateNotificationPeople implements NotificationSignalExtractor {
public void applyChangesLocked(NotificationRecord operand) {
float affinityBound = operand.getContactAffinity();
operand.setContactAffinity(Math.max(mContactAffinity, affinityBound));
- if (INFO) Slog.i(TAG, "final affinity: " + operand.getContactAffinity());
+ if (VERBOSE) Slog.i(TAG, "final affinity: " + operand.getContactAffinity());
}
public float getContactAffinity() {