diff options
Diffstat (limited to 'logd/LogBuffer.cpp')
-rw-r--r-- | logd/LogBuffer.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp index 6770bb7f2..3ce6b61e0 100644 --- a/logd/LogBuffer.cpp +++ b/logd/LogBuffer.cpp @@ -199,22 +199,24 @@ int LogBuffer::log(log_id_t log_id, log_time realtime, LogBufferElement *elem = new LogBufferElement(log_id, realtime, uid, pid, tid, msg, len); - int prio = ANDROID_LOG_INFO; - const char *tag = NULL; - if (log_id == LOG_ID_EVENTS) { - tag = android::tagToName(elem->getTag()); - } else { - prio = *msg; - tag = msg + 1; - } - if (!__android_log_is_loggable(prio, tag, ANDROID_LOG_VERBOSE)) { - // Log traffic received to total - pthread_mutex_lock(&mLogElementsLock); - stats.add(elem); - stats.subtract(elem); - pthread_mutex_unlock(&mLogElementsLock); - delete elem; - return -EACCES; + if (log_id != LOG_ID_SECURITY) { + int prio = ANDROID_LOG_INFO; + const char *tag = NULL; + if (log_id == LOG_ID_EVENTS) { + tag = android::tagToName(elem->getTag()); + } else { + prio = *msg; + tag = msg + 1; + } + if (!__android_log_is_loggable(prio, tag, ANDROID_LOG_VERBOSE)) { + // Log traffic received to total + pthread_mutex_lock(&mLogElementsLock); + stats.add(elem); + stats.subtract(elem); + pthread_mutex_unlock(&mLogElementsLock); + delete elem; + return -EACCES; + } } pthread_mutex_lock(&mLogElementsLock); @@ -484,7 +486,7 @@ bool LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) { } // prune by worst offender by uid - bool hasBlacklist = mPrune.naughty(); + bool hasBlacklist = (id != LOG_ID_SECURITY) && mPrune.naughty(); while (!clearAll && (pruneRows > 0)) { // recalculate the worst offender on every batched pass uid_t worst = (uid_t) -1; @@ -654,7 +656,7 @@ bool LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) { } bool whitelist = false; - bool hasWhitelist = mPrune.nice() && !clearAll; + bool hasWhitelist = (id != LOG_ID_SECURITY) && mPrune.nice() && !clearAll; it = mLogElements.begin(); while((pruneRows > 0) && (it != mLogElements.end())) { LogBufferElement *e = *it; |